forked from samtupy/nvgt
-
Notifications
You must be signed in to change notification settings - Fork 0
235 lines (227 loc) · 7.17 KB
/
Copy pathrelease.yml
File metadata and controls
235 lines (227 loc) · 7.17 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: release
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
mac_build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: build
run: |
cp build/build_macos.sh .
sudo chmod +x build_macos.sh
./build_macos.sh ci
- uses: actions/upload-artifact@v4
with:
name: mac_release
path: 'release'
linux_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: build
run: |
pip3 install scons
sudo chmod +x build/build_linux.sh
./build/build_linux.sh ci
- uses: actions/upload-artifact@v4
with:
name: linux_release
path: 'release'
android_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
link-to-sdk: true
add-to-path: true
- name: keystore_official
if: github.event.repository.fork == false
run: |
cd jni
echo "${{secrets.ANDROID_RUNNER_KEYSTORE}}" > android_enc.keystore
cat android_enc.keystore | base64 -d > android.keystore
echo "ANDROID_RUNNER_KEYSTORE_PW=${{secrets.ANDROID_RUNNER_KEYSTORE_PW}}" >> $GITHUB_ENV
cd ..
- name: keystore_unofficial
if: github.event.repository.fork == true
run: |
cd jni
keytool -genkey -keyalg RSA -keysize 2048 -v -keystore android.keystore -dname cn=NVGT -storepass Android1422207 -validity 10000 -alias app
echo "ANDROID_RUNNER_KEYSTORE_PW=Android1422207">>$GITHUB_ENV
cd ..
- name: build
run: |
curl -s -O https://nvgt.gg/droidev.zip
mkdir -p droidev
cd droidev
unzip -q ../droidev.zip
cd ../jni
./gradlew assembleRunnerRelease AssembleStubRelease --no-daemon -Pandroid.injected.signing.store.file=android.keystore -Pandroid.injected.signing.store.password=${{env.ANDROID_RUNNER_KEYSTORE_PW}} -Pandroid.injected.signing.key.alias=app -Pandroid.injected.signing.key.password="${{env.ANDROID_RUNNER_KEYSTORE_PW}}"
mv build/outputs/apk/runner/release/nvgt-runner-release.apk ../release/nvgt.apk
cd ..
- uses: actions/upload-artifact@v4
with:
name: android_release
path: 'release'
windows_build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: build
run: |
pip3 install scons
choco install -y upx
curl -s -O https://nvgt.gg/windev.zip
7z x windev.zip -owindev
scons -s no_upx=0
- uses: actions/upload-artifact@v4
with:
name: windows_release
path: 'release'
windows_package:
runs-on: windows-latest
needs: ["android_build", "linux_build", "mac_build", "windows_build"]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: set_version
run: |
python3 build/ci_set_version.py
- name: package
run: |
rm -r release
mv windows_release release
cd doc
pip3 install -r requirements.txt
cd OSL
python3 make_osl_document.py
cd ..
python3 docgen.py
cd ..
cp android_release/stub/* release/stub
cp -r linux_release/lib release/lib_linux
cp linux_release/stub/* release/stub
cp -r mac_release/lib release/lib_mac
cp mac_release/stub/* release/stub
cd install
iscc nvgt.iss
cd ..
- uses: actions/upload-artifact@v4
with:
name: windows_package
path: 'install/nvgt_${{env.nvgt_version}}.exe'
mac_package:
runs-on: macos-latest
needs: ["android_build", "linux_build", "mac_build", "windows_build"]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: set_version
run: |
python3 build/ci_set_version.py
- name: package
run: |
rm -r release
mv mac_release release
cd doc
pip3 install --user -r requirements.txt --break-system-packages
cd OSL
python3 make_osl_document.py
cd ..
python3 docgen.py
cd ..
cp android_release/stub/* release/stub
cp -r linux_release/lib release/lib_linux
cp linux_release/stub/* release/stub
cp -r windows_release/lib release/lib_windows
cp windows_release/stub/* release/stub
cd install
python3 make_dmg.py ../release
- uses: actions/upload-artifact@v4
with:
name: mac_package
path: 'install/nvgt_${{env.nvgt_version}}.dmg'
linux_package:
runs-on: ubuntu-latest
needs: ["android_build", "linux_build", "mac_build", "windows_build"]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: set_version
run: |
python3 build/ci_set_version.py
- name: package
run: |
rm -r release
mv linux_release release
python3 -m venv venv --upgrade-deps
chmod +x venv/bin/activate
source ./venv/bin/activate
cd doc
pip3 install -r requirements.txt
cd OSL
python3 make_osl_document.py
cd ..
python3 docgen.py
cd ..
cp android_release/stub/* release/stub
cp -r mac_release/lib release/lib_mac
cp mac_release/stub/* release/stub
cp -r windows_release/lib release/lib_windows
cp windows_release/stub/* release/stub
cd release
tar -czf "../nvgt_$nvgt_version.tar.gz" *
cd ..
- uses: actions/upload-artifact@v4
with:
name: linux_package
path: 'nvgt_${{env.nvgt_version}}.tar.gz'
publish_release:
runs-on: ubuntu-latest
needs: ["windows_package", "mac_package", "linux_package"]
if: github.ref_type == 'tag' && github.event.repository.fork == false
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: '*_package'
- uses: actions/download-artifact@v4
with:
name: android_release
path: android_release
- name: set_version
run: |
python3 build/ci_set_version.py
- name: publish
run: |
mkdir android_package
mv android_release/nvgt.apk android_package/nvgt_android_$nvgt_version.apk
curl -u "${{secrets.CIFTP}}" -s -T "android_package/nvgt_$nvgt_version.apk" ftp://nvgt.gg
curl -u "${{secrets.CIFTP}}" -s -T "linux_package/nvgt_$nvgt_version.tar.gz" ftp://nvgt.gg
curl -u "${{secrets.CIFTP}}" -s -T "mac_package/nvgt_$nvgt_version.dmg" ftp://nvgt.gg
curl -u "${{secrets.CIFTP}}" -s -T "windows_package/nvgt_$nvgt_version.exe" ftp://nvgt.gg
curl -H "X-Auth: ${{secrets.CIPHP}}" -s "https://nvgt.gg/ci/release_complete.php?ver=$nvgt_version"
- uses: ghalactic/github-release-from-tag@v5
with:
checksumGenerateAssets: "false"
assets: |
- path: '*_package/nvgt_${{env.nvgt_version}}.*'