-
Notifications
You must be signed in to change notification settings - Fork 15
129 lines (116 loc) · 4.27 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
jobs:
build-with-zulu:
name: ${{ matrix.os }}(${{ matrix.type }}) ${{ matrix.arch }} with Auzl Zulu
runs-on: ${{ matrix.label }}
strategy:
fail-fast: false
matrix:
include:
- { label: windows-latest, os: Windows, arch: x86_64, type: msi }
- { label: windows-latest, os: Windows, arch: x86_64, type: app-image }
- { label: macos-13, os: macOS, arch: x86_64, type: dmg }
- { label: macos-13, os: macOS, arch: x86_64, type: pkg }
- { label: macos-13, os: macOS, arch: x86_64, type: app-image }
- { label: macos-latest, os: macOS, arch: aarch64, type: dmg }
- { label: macos-latest, os: macOS, arch: aarch64, type: pkg }
- { label: macos-latest, os: macOS, arch: aarch64, type: app-image }
steps:
- name: Checkout MiniLPA
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build Native Executable
shell: pwsh
run: |
./scripts/Build.ps1 -NativeExecutable -NativeExecutableType ${{ matrix.type }}
- name: Get Short Commit Id
shell: pwsh
run: |
"SHORT_COMMIT_ID=$($Env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $Env:GITHUB_ENV -Append
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: MiniLPA-${{ env.SHORT_COMMIT_ID }}-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.type }}
path: |
build/dist/
build-with-jbr:
name: ${{ matrix.os }}(${{ matrix.type }}) ${{ matrix.arch }} ${{ matrix.wayland && 'Wayland' || '' }} with JetBrains Runtime
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
type: [ deb, rpm, app-image ]
wayland: [ true, false ]
include:
- os: Linux
- arch: x86_64
steps:
- name: Checkout MiniLPA
uses: actions/checkout@v4
- name: Checkout JetBrains Setup
uses: actions/checkout@v4
with:
repository: ShiinaSekiu/github-actions-jbr-setup
ref: jdk
path: .github/shared_actions/jbr
- name: Install JetBrains Runtime
uses: ./.github/shared_actions/jbr/setup_jbr21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build Native Executable
shell: pwsh
run: |
./scripts/Build.ps1 -NativeExecutable -NativeExecutableType ${{ matrix.type }} -NativeWayland:$${{ matrix.wayland }} -GithubToken ${{ secrets.GITHUB_TOKEN }}
- name: Get Short Commit Id
shell: pwsh
run: |
"SHORT_COMMIT_ID=$($Env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $Env:GITHUB_ENV -Append
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: MiniLPA-${{ env.SHORT_COMMIT_ID }}-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.type }}${{ matrix.wayland && '-Wayland' || '' }}
path: |
build/dist/
release:
name: Release
runs-on: macos-latest
needs: [ build-with-zulu, build-with-jbr ]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Get Artifact SHA256
id: artifact-hash
shell: pwsh
run: |
'sha256<<EOF' | Out-File -Path $Env:GITHUB_OUTPUT -Append
Get-ChildItem | ForEach-Object { (Get-FileHash $_.FullName -Algorithm SHA256).Hash + ' ' + $_.Name | Out-File -Path $Env:GITHUB_OUTPUT -Append }
'EOF' | Out-File -Path $Env:GITHUB_OUTPUT -Append
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
append_body: true
body: |
## Artifacts SHA256 Hashes
```
${{ steps.artifact-hash.outputs.sha256 }}
```
files: '*'