Skip to content

Commit fd848ec

Browse files
authored
Create release.yml
1 parent 94f73e6 commit fd848ec

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Tauri v2 Release Process
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
CN_APPLICATION: "com.foobar.app"
13+
14+
jobs:
15+
draft:
16+
runs-on: ubuntu-22.04
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: create draft release
21+
uses: crabnebula-dev/cloud-release@v0
22+
with:
23+
command: release draft ${{ env.CN_APPLICATION }} --framework tauri
24+
api-key: ${{ secrets.CN_API_KEY }}
25+
26+
build:
27+
needs: draft
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os:
33+
- ubuntu-22.04
34+
- macos-latest
35+
- windows-latest
36+
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: "20"
44+
- name: Install stable toolchain
45+
uses: actions-rust-lang/setup-rust-toolchain@v1
46+
with:
47+
toolchain: stable
48+
cache: true
49+
50+
- name: install Linux dependencies
51+
if: matrix.os == 'ubuntu-22.04'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y webkit2gtk-4.1
55+
56+
- name: build Tauri app for Windows, Linux
57+
if: matrix.os != 'macos-latest'
58+
run: |
59+
npm ci
60+
npm run tauri build
61+
env:
62+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
63+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
64+
65+
- name: Install x86_64-apple-darwin for mac and build Tauri binaries
66+
if: matrix.os == 'macos-latest'
67+
run: |
68+
rustup target add x86_64-apple-darwin
69+
npm ci
70+
npm run tauri build -- --target x86_64-apple-darwin
71+
npm run tauri build -- --target aarch64-apple-darwin
72+
env:
73+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
74+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
75+
76+
- name: upload assets
77+
uses: crabnebula-dev/cloud-release@v0
78+
with:
79+
command: release upload ${{ env.CN_APPLICATION }} --framework tauri
80+
api-key: ${{ secrets.CN_API_KEY }}
81+
path: ./src-tauri
82+
83+
publish:
84+
needs: build
85+
86+
runs-on: ubuntu-22.04
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: publish release
92+
uses: crabnebula-dev/cloud-release@v0
93+
with:
94+
command: release publish ${{ env.CN_APPLICATION }} --framework tauri
95+
api-key: ${{ secrets.CN_API_KEY }}

0 commit comments

Comments
 (0)