-
Notifications
You must be signed in to change notification settings - Fork 75
234 lines (220 loc) · 6.76 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
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
name: Release
on:
create:
tags:
- 'v*' # Version tag
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: Swatinem/[email protected]
- name: Publish crate
continue-on-error: true
run: cargo publish --manifest-path kalk/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
- name: Publish CLI
run: sleep 20 && cargo publish --manifest-path cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
publish_npm:
name: publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: Swatinem/[email protected]
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build
run: |
yarn install
cd kalk
wasm-pack build --scope paddim8 -- --no-default-features
cd ..
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./kalk/pkg/package.json
access: public
publish_kalk_web:
name: publish kalk_web
if: always()
runs-on: ubuntu-latest
needs: [publish_npm]
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: build
run: |
cd web
npm install
cd ..
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./web/package.json
access: public
release_linux:
name: release linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: Swatinem/[email protected]
- name: Compile
run: |
cargo build --release --verbose
mkdir build
cp target/release/kalker build/kalker-linux
- uses: actions/upload-artifact@v4
with:
name: linux
path: build/kalker-linux
release_mac:
name: release mac
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
target
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Compile
run: |
cargo build --release --verbose
mkdir build
zip -r build/kalker-macOS.zip target/release/kalker
- uses: actions/upload-artifact@v4
with:
name: macOS
path: build/kalker-macOS.zip
release_windows:
name: release windows
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
path: |
C:\Users\runneradmin\.cargo\bin\cargo-wix
C:\Users\runneradmin\.cargo\registry\index
C:\Users\runneradmin\.cargo\registry\cache
C:\Users\runneradmin\.cargo\registry\cache
{FOLDERID_LocalAppData}\gmp-mpfr-sys
D:\a\kalker\kalker\target
C:\msys64\home\paddi\kalker\target
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
pacman-mirrors
diffutils
m4
make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-rust
continue-on-error: true
- shell: msys2 {0}
run: |
cargo build --release --verbose
- uses: crazy-max/ghaction-chocolatey@v1
with:
args: install wixtoolset -y
- shell: msys2 {0}
run: |
[ ! -f /c/Users/runneradmin/.cargo/bin/cargo-wix.exe ] && cargo install cargo-wix --version 0.3.1
cd cli
cargo wix --no-build --nocapture
mkdir ../build
mv target/wix/*.msi ../build/kalker-windows.msi
- uses: actions/upload-artifact@v4
with:
name: win64
path: build/kalker-windows.msi
release_android:
name: release android
if: false
runs-on: ubuntu-latest
needs: [publish_kalk_web]
defaults:
run:
working-directory: ./mobile
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: |
mobile/android/.gradle
mobile/android/build
mobile/android/app/build
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: npm
run: |
npm install
npm run build
- name: build app
run: |
npx cap sync
cd android
version=$(cat ../../web/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
APP_VERSION_NAME=$version ./gradlew assembleRelease
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- uses: r0adkll/sign-android-release@v1
name: sign apk
with:
releaseDirectory: mobile/android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
- run: |
mkdir ../build
mv $(ls -Art android/app/build/outputs/apk/release/*.apk | tail -n 1) ../build/kalker-android.apk
- uses: actions/upload-artifact@v4
with:
name: android
path: build/kalker-android.apk
create_release:
name: Create Release
if: always()
needs: [release_linux, release_mac, release_windows]
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
- name: Upload Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} build/**/*