-
-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (144 loc) · 5.7 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
on:
push:
release:
types: [ created ]
name: Build
permissions:
contents: write
jobs:
build:
name: Build
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: "gradle"
# holy shit thats alot of caching
# - name: Cache appAndroid
# if: matrix.os == 'ubuntu-latest'
# uses: actions/cache@v3
# with:
# path: appAndroid/build
# key: ${{ runner.os }}-appAndroid-${{ hashFiles('appAndroid/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache appDesktop
uses: actions/cache@v3
with:
path: appDesktop/build
key: ${{ runner.os }}-appDesktop-${{ hashFiles('appDesktop/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache genesisApp
uses: actions/cache@v3
with:
path: genesis/app/build
key: ${{ runner.os }}-genesis-app-${{ hashFiles('genesis/app/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Cache genesisCommon
uses: actions/cache@v3
with:
path: genesis/common/build
key: ${{ runner.os }}-genesis-common-${{ hashFiles('genesis/common/**', 'build.gradle.kts', 'gradle.properties', 'gradle/libs.versions.toml') }}
- name: Setup Android SDK
if: matrix.os == 'ubuntu-latest'
uses: android-actions/setup-android@v3
- name: Install rpm-tools on Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install rpm
- name: Build linux
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew appAndroid:build
./gradlew package
./gradlew --stop
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
./gradlew :appDesktop:createDistributable
./gradlew :appDesktop:package
./gradlew --stop
cd appDesktop/build/compose/binaries/main/
Compress-Archive -Path app -Destination genesis.zip
- name: Build iOS Release
if: matrix.os == 'macos-latest' && github.event_name == 'release'
run: |
xcrun xcodebuild archive -project appiOS/genesis.xcodeproj -scheme genesis -configuration Release -archivePath "appIos/build/genesis.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cd appIos/build/genesis.xcarchive/Products
mv Applications Payload
zip -r ../../genesis.ipa Payload
- name: Build iOS Debug
if: matrix.os == 'macos-latest' && github.event_name != 'release'
run: |
xcrun xcodebuild archive -project appiOS/genesis.xcodeproj -scheme genesis -configuration Debug -archivePath "appIos/build/genesis.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cd appIos/build/genesis.xcarchive/Products
mv Applications Payload
zip -r ../../genesis.ipa Payload
- name: Upload IPA
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: genesis.ipa
path: appIos/build/genesis.ipa
- name: Upload DEB
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: genesis.deb
path: appDesktop/build/compose/binaries/main/deb/*.deb
- name: Upload RPM
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: genesis.rpm
path: appDesktop/build/compose/binaries/main/rpm/*.rpm
- name: Upload ZIP
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: genesis.zip
path: appDesktop/build/compose/binaries/main/genesis.zip
- name: Upload EXE
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: genesis.exe
path: appDesktop/build/compose/binaries/main/exe/*.exe
- name: Upload Release APK
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && github.event_name == 'release'
with:
name: genesis.apk
path: appAndroid/build/outputs/apk/release/appAndroid-release-unsigned.apk
- name: Upload Debug APK
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && github.event_name != 'release'
with:
name: genesis.apk
path: appAndroid/build/outputs/apk/debug/appAndroid-debug.apk
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
appDesktop/build/compose/binaries/main/deb/*.deb
appDesktop/build/compose/binaries/main/genesis.zip
appAndroid/build/outputs/apk/release/appAndroid-release-unsigned.apk
appIos/build/genesis.ipa
- name: Notify Release
if: github.event_name == 'release'
run: |
curl -X POST -H "Authorization: ${{ secrets.PRESHARED_KEY }}" https://genesisapi.loveh.art/api/v0/release
- name: Clean up windows
if: matrix.os == 'windows-latest'
run: |
Remove-Item -Path appDesktop/build/compose/binaries -Recurse -Force
- name: Clean up linux
if: matrix.os == 'ubuntu-latest'
run: |
rm -rf appDesktop/build/compose/binaries
rm -rf appAndroid/build/outputs