@@ -2,8 +2,9 @@ name: Release CI
22
33on :
44 push :
5- branches :
6- - release
5+ # Sequence of patterns matched against refs/tags
6+ tags :
7+ - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
78
89jobs :
910 create-release :
@@ -12,24 +13,22 @@ jobs:
1213 RELEASE_UPLOAD_ID : ${{ steps.create_release.outputs.id }}
1314
1415 steps :
15- - uses : actions/checkout@v2
16- - name : Setup node
17- uses : actions/setup-node@v1
18- with :
19- node- version: 16
20- - name : Get version
21- run : echo "PACKAGE_VERSION=$(node -p "require('./src-tauri/tauri.conf.json').package.version")" >> $GITHUB_ENV
22- - name : Create release
16+ - name : Query version number
17+ id : get_version
18+ shell : bash
19+ run : |
20+ echo "using version tag ${GITHUB_REF:10}"
21+ echo ::set-output name= version::"${GITHUB_REF:10}"
22+
23+ - name : Create Release
2324 id : create_release
2425 uses : actions/create-release@v1
2526 env :
2627 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2728 with :
28- tag_name : v${{ env.PACKAGE_VERSION }}
29- release_name : ' OhMyBox v${{ env.PACKAGE_VERSION }}'
29+ tag_name : v${{ steps.get_version.outputs.VERSION }}
30+ release_name : ' OhMyBox v${{ steps.get_version.outputs.VERSION }}'
3031 body : ' See the assets to download this version and install.'
31- draft : true
32- prerelease : false
3332
3433 build-tauri :
3534 needs : create-release
@@ -41,36 +40,39 @@ jobs:
4140 runs-on : ${{ matrix.platform }}
4241 steps :
4342 - uses : actions/checkout@v2
43+
4444 - name : setup node
4545 uses : actions/setup-node@v1
4646 with :
4747 node-version : 16
48+
4849 - name : install Rust stable
4950 uses : actions-rs/toolchain@v1
5051 with :
5152 toolchain : stable
53+
54+ - uses : Swatinem/rust-cache@v1
55+
5256 - name : install dependencies (ubuntu only)
5357 if : matrix.platform == 'ubuntu-latest'
5458 run : |
5559 sudo apt-get update
5660 sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
5761
58- # Install wasm-pack
62+ - name : Install wasm-pack
59636064 with :
6165 # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
6266 version : v0.9.1
6367
64- # Install rsw
6568 - name : Install rsw
6669 run : cargo install rsw
6770
68- # Cache
6971 - name : Get yarn cache directory path
7072 id : yarn-cache-dir-path
7173 run : echo "::set-output name=dir::$(yarn config get cacheFolder)"
7274
73- - name : Yarn Cache
75+ - name : Yarn cache
7476 uses : actions/cache@v2
7577 id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
7678 with :
7981 restore-keys : |
8082 ${{ runner.os }}-yarn-
8183
82- # Install & Build
8384 - name : Install app dependencies and build it
8485 run : yarn && yarn build
8586 - uses : tauri-apps/tauri-action@v0
0 commit comments