-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (149 loc) · 4.49 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: release
on:
push:
tags:
- 'v*'
jobs:
build-windows:
name: windows build
runs-on: windows-latest
steps:
- name: Install NSIS
run: |
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop update
scoop install main/xmake
$env:path+=";$Home\scoop\shims"
xmake --version
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: build-x86_64
env:
VERSION: ${{ github.ref_name }}
shell: powershell
run: |
$env:path+=";$Home\scoop\shims"
xmake f -c -y
tree /f .xmake\windows\x64\repositories\xrepo
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: build-x64
env:
VERSION: ${{ github.ref_name }}
run: |
xmake f -c -y --target_minver=10.13
xmake build -y onscripter
- name: build-arm64
env:
VERSION: ${{ github.ref_name }}
ARCH: arm64
run: |
xmake f -a arm64 -c -y --target_minver=12.01
xmake build -y onscripter
- name: build-iphone
env:
VERSION: ${{ github.ref_name }}
ARCH: arm64
run: |
xmake f -p iphoneos --target_minver=12.0 -y -c
xmake b onscripter-oc
xmake package onscripter-oc
cp build/iphoneos/arm64/release/onscripter-oc.ipa dist/
- uses: actions/upload-artifact@v3
with:
name: onscripter-osx-${{ github.run_id }}
path: |
dist/onscripter-darwin-x86_64
dist/onscripter-darwin-arm64
dist/onscripter-oc.ipa
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: install-xmake
run: |
./script/xmake-install.sh xmake-amd64.deb
sudo apt-get install -y ./xmake-amd64.deb
rm ./xmake-amd64.deb
xmake --version
- name: cert
env:
CERT_TEXT: ${{ secrets.CERT_TEXT }}
VERSION: ${{ github.ref_name }}
run: |
cd project/android
echo "org.gradle.java.home=${JAVA_HOME_11_X64}" >> gradle.properties
echo "versionName=${VERSION}" >> local.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 ../../
mkdir -p dist
- 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_17_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-android-${{ github.run_id }}
path: |
dist/onscripter-release.apk
update-release:
runs-on: ubuntu-latest
needs: [build-osx, build-windows, build-android]
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
- uses: actions/download-artifact@v3
with:
name: onscripter-android-${{ 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/') && github.ref_name != 'v0.0.0'
with:
files: |
dist/onscripter-windows-x86_64.exe
dist/onscripter-darwin-x86_64
dist/onscripter-darwin-arm64
dist/onscripter-release.apk
dist/onscripter-oc.ipa