-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (100 loc) · 3.17 KB
/
rust.yml
File metadata and controls
118 lines (100 loc) · 3.17 KB
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
name: Tauri Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
build_type:
description: 'Build type'
required: false
default: 'release'
type: choice
options:
- release
- debug
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build-windows:
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-pc-windows-msvc
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Rust build artifacts
uses: actions/cache@v4
with:
path: |
./src-tauri/target
key: ${{ runner.os }}-rust-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-target-
- name: Install Tauri CLI
run: cargo install tauri-cli --locked
- name: Verify Tauri CLI installation
run: cargo tauri --version
- name: Build Tauri application
run: cargo tauri build
working-directory: .
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: List build artifacts
run: |
echo "=== Build Artifacts ==="
dir src-tauri\target\release\bundle\msi\*.msi 2>nul || echo "No MSI files found"
dir src-tauri\target\release\bundle\nsis\*.exe 2>nul || echo "No NSIS files found"
- name: Upload MSI installer
uses: actions/upload-artifact@v4
with:
name: viewstage-msi
path: src-tauri/target/release/bundle/msi/*.msi
if-no-files-found: warn
retention-days: 30
- name: Upload NSIS installer
uses: actions/upload-artifact@v4
with:
name: viewstage-nsis
path: src-tauri/target/release/bundle/nsis/*.exe
if-no-files-found: warn
retention-days: 30
create-release:
needs: build-windows
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/viewstage-msi/*.msi
artifacts/viewstage-nsis/*.exe
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}