-
Notifications
You must be signed in to change notification settings - Fork 27
196 lines (168 loc) · 5.89 KB
/
Build.yml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
on:
push:
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
BuildBinaries:
name: Build application packages
strategy:
matrix:
runtime: [ linux-x64, osx-x64, osx-arm64, win-x64, android ]
include:
- runtime: linux-x64
arch: x64
os: ubuntu-latest
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDeb
setupCl: ./scripts/SetupClUnix.sh
- runtime: osx-x64
arch: x64
os: macOS-latest
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh
- runtime: osx-arm64
arch: aarch64
os: macOS-14
shell: bash
build: packageReleaseUberJarForCurrentOS packageReleaseDmg notarizeReleaseDmg
setupCl: ./scripts/SetupClUnix.sh
- runtime: win-x64
arch: x64
os: windows-latest
shell: powershell
build: packageReleaseUberJarForCurrentOS packageReleaseMsi
setupCl: ./scripts/SetupClWindows.ps1
- runtime: android
arch: x64
os: ubuntu-latest
shell: bash
build: :android:assembleRelease
setupCl: ./scripts/SetupClUnix.sh
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
architecture: ${{ matrix.arch }}
- name: Set up gradle
uses: gradle/actions/setup-gradle@v4
- name: Setup Cl
run: ${{ matrix.setupCl }}
- name: Setup MacOS Keychain
uses: apple-actions/import-codesign-certs@v3
if: ${{ matrix.runtime == 'osx-x64' || matrix.runtime == 'osx-arm64' }}
with:
p12-file-base64: ${{ secrets.APPLE_CERT }}
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
- name: Build
run: >
./gradlew
${{ matrix.build }}
-P"compose.desktop.mac.sign=true"
-P"compose.desktop.mac.signing.identity=${{ secrets.APPLE_IDENTITY }}"
-P"compose.desktop.mac.notarization.appleID=${{ secrets.APPLE_ID }}"
-P"compose.desktop.mac.notarization.password=${{ secrets.APPLE_PASSWORD }}"
-P"compose.desktop.mac.notarization.teamID=${{ secrets.APPLE_TEAM_ID }}"
- name: Sign APK
uses: ilharp/sign-android-release@v1
if: ${{ matrix.runtime == 'android' }}
with:
releaseDir: android/build/outputs/apk/release
signingKey: ${{ secrets.ANDROID_SIGNING_KEY }}
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
# Upload runner package tar.gz/zip as artifact
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: runner-package-${{ matrix.runtime }}
path: |
desktop/build/compose/binaries/main/*/
desktop/build/compose/binaries/main-release/*/
desktop/build/compose/jars/
!desktop/build/compose/binaries/main/app/
!desktop/build/compose/binaries/main-release/app/
${{ env.ANDROID_SIGNED_FILE }}
# Upload runner errors
- name: Upload error logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: runner-errors-${{ matrix.runtime }}
path: |
desktop/build/compose/logs/
BuildRpm:
name: Build application RPM package
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Cl
run: ./scripts/SetupClUnix.sh
- name: Set commit count
shell: bash
run: |
commit_count=$(git rev-list --count HEAD)
echo "COMMIT_COUNT=$commit_count" >> $GITHUB_ENV
- name: Build rpm Package
uses: Syer10/Fedora-Java17-Action@v1
with:
command: ./gradlew packageReleaseRpm --stacktrace
# Upload runner package tar.gz/zip as artifact
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: runner-package-linux-fedora-x64
path: |
desktop/build/compose/binaries/main/*/
desktop/build/compose/binaries/main-release/*/
desktop/build/compose/jars/
!desktop/build/compose/binaries/main/app/
!desktop/build/compose/binaries/main-release/app/
# Upload runner errors
- name: Upload error logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: runner-errors-linux-fedora-x64
path: |
desktop/build/compose/logs/
ReleaseBinaries:
name: Make a release
needs: [ BuildBinaries,BuildRpm ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Build Artifacts
uses: actions/download-artifact@v4
- name: Fix rpm java dependency
uses: Syer10/Fedora-Java17-Action@v1
with:
command: ./scripts/RpmDependencyFix.sh
- name: Fix deb java dependency
run: ./scripts/DebDependencyFix.sh
- name: Fix filenames
run: ./scripts/NamingFix.sh
- uses: ncipollo/release-action@v1
with:
artifacts: "*/binaries/main/*/*.*,*/binaries/main-release/*/*.*,*/jars/*.jar,*/android/build/outputs/apk/release/*.apk"
draft: true
token: ${{ secrets.WINGET_PUBLISH_PAT }}