Skip to content

Commit b07c6c8

Browse files
1 parent a255138 commit b07c6c8

File tree

1 file changed

+40
-41
lines changed

1 file changed

+40
-41
lines changed

.github/workflows/rust.yml

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
1-
name: Build and Release Tauri App
2-
1+
name: Release
32
on:
43
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
8-
9-
env:
10-
CARGO_TERM_COLOR: always
4+
tags:
5+
- "v*"
6+
workflow_dispatch:
117

128
jobs:
13-
build:
14-
runs-on: windows-latest
9+
release:
10+
permissions:
11+
contents: write
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [macos-latest, windows-latest] # Ubuntu-20.04 has been removed
16+
runs-on: ${{ matrix.platform }}
1517

1618
steps:
17-
- name: Checkout code
19+
- name: Checkout repository
1820
uses: actions/checkout@v3
1921

20-
- name: Set up Rust
21-
uses: actions-rs/toolchain@v1
22+
- name: Install dependencies (ubuntu only)
23+
if: matrix.platform == 'ubuntu-20.04'
24+
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
28+
29+
- name: Rust setup
30+
uses: dtolnay/rust-toolchain@stable
31+
32+
- name: Rust cache
33+
uses: swatinem/rust-cache@v2
2234
with:
23-
toolchain: stable
24-
override: true
35+
workspaces: "./src-tauri -> target"
2536

26-
- name: Install Tauri CLI
27-
run: cargo install tauri-cli
37+
- name: Sync node version and setup cache
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: "lts/*"
41+
cache: "npm" # Set this to npm, yarn or pnpm.
2842

29-
- name: Build Tauri App
30-
run: cargo tauri build
43+
- name: Install frontend dependencies
44+
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
45+
run: npm install # Change this to npm, yarn or pnpm.
3146

32-
- name: Sign Tauri App
33-
env:
34-
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
35-
run: tauri signer sign -p <(echo "$TAURI_PRIVATE_KEY") -f src-tauri/target/release/bundle/msi/*.msi
47+
- name: Build the app
48+
uses: tauri-apps/tauri-action@v0
3649

37-
- name: Create Release
38-
id: create_release
39-
uses: actions/create-release@v1
4050
env:
4151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4252
with:
43-
tag_name: ${{ github.sha }}
44-
release_name: Release ${{ github.sha }}
45-
draft: false
53+
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
54+
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
55+
releaseBody: "See the assets to download and install this version."
56+
releaseDraft: true
4657
prerelease: false
47-
48-
- name: Upload Release Assets
49-
uses: actions/upload-release-asset@v1
50-
with:
51-
upload_url: ${{ steps.create_release.outputs.upload_url }}
52-
asset_path: |
53-
src-tauri/target/release/bundle/msi/*.msi
54-
src-tauri/target/release/bundle/msi/*.sig
55-
asset_name: |
56-
$(basename src-tauri/target/release/bundle/msi/*.msi)
57-
$(basename src-tauri/target/release/bundle/msi/*.sig)
58-
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)