-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (130 loc) · 3.86 KB
/
release.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
name: release
on:
push:
tags:
- 'v*'
jobs:
build-windows:
name: windows build
runs-on: windows-latest
steps:
- name: Setup Windows 10 SDK version 10.0.20348.0
uses: GuillaumeFalourd/[email protected]
with:
sdk-version: 20348
- name: Install NSIS
run: |
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop update
scoop install main/xmake
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: pre-repo
shell: powershell
run: |
$env:path+=";$Home\scoop\shims"
xrepo add-repo local https://github.com/zeromake/xrepo.git
- name: build-x86_64
env:
VERSION: ${{ github.ref_name }}
shell: powershell
run: |
$env:path+=";$Home\scoop\shims"
xmake f -c -y
xmake build -y onscripter
- uses: actions/upload-artifact@v3
with:
name: onscripter-windows-${{ github.run_id }}
path: |
dist/onscripter-windows-x86_64.exe
build-osx:
name: macos build
runs-on: macos-latest
steps:
- name: install-xmake
run: |
brew install xmake
xmake --version
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: pre-repo
run: |
xrepo add-repo local https://github.com/zeromake/xrepo.git
- name: build-x64
env:
VERSION: ${{ github.ref_name }}
run: |
xmake f -c -y
xmake build -y onscripter
- name: build-arm64
env:
VERSION: ${{ github.ref_name }}
ARCH: arm64
run: |
xmake f -a arm64 -c -y
xmake build -y onscripter
- name: cert
env:
CERT_TEXT: ${{ secrets.CERT_TEXT }}
run: |
cd project/android
echo "org.gradle.java.home=$JAVA_HOME_11_X64" >> gradle.properties
echo $CERT_TEXT > cert.txt
cat cert.txt | base64 -d > cert.tar.xz
tar -xf cert.tar.xz
rm cert.tar.xz cert.txt
ls -lh keystore.properties release.keystore
cd ../../
- name: build-arm-so
env:
VERSION: ${{ github.ref_name }}
run: |
xmake f -p android -a armeabi-v7a --ndk_sdkver=16 --ndk=${ANDROID_HOME}/ndk/23.2.8568313 -y -c
xmake build -y onscripter
- name: build-arm64-so
env:
VERSION: ${{ github.ref_name }}
run: |
xmake f -p android -a arm64-v8a --ndk_sdkver=21 --ndk=${ANDROID_NDK} -y -c
xmake build -y onscripter
- name: build-apk
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
cd project/android
./gradlew assembleRelease
cp ./app/build/outputs/apk/release/app-release.apk ../../dist/onscripter-release.apk
cd ../../
- uses: actions/upload-artifact@v3
with:
name: onscripter-osx-${{ github.run_id }}
path: |
dist/onscripter-darwin-x86_64
dist/onscripter-darwin-arm64
dist/onscripter-release.apk
update-release:
runs-on: ubuntu-latest
needs: [build-osx, build-windows]
steps:
- uses: actions/download-artifact@v3
with:
name: onscripter-windows-${{ github.run_id }}
path: dist
- uses: actions/download-artifact@v3
with:
name: onscripter-osx-${{ github.run_id }}
path: dist
- name: list file
run: |
ls -R
- name: update
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/onscripter-windows-x86_64.exe
dist/onscripter-darwin-x86_64
dist/onscripter-darwin-arm64
dist/onscripter-release.apk