-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (95 loc) · 3.22 KB
/
Copy pathrelease.yml
File metadata and controls
111 lines (95 loc) · 3.22 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "--target aarch64-apple-darwin"
- platform: "macos-latest"
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"
args: "--target x86_64-unknown-linux-gnu"
- platform: "windows-latest"
args: "--target x86_64-pc-windows-msvc"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Cache Node.js dependencies
uses: actions/cache@v4
with:
path: |
~/.npm
~/.cache/npm
web/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install frontend dependencies
run: npm ci
working-directory: web
- name: Clean previous build
run: |
rm -rf ../dist || true
shell: bash
working-directory: web
- name: Build frontend
run: |
echo "Building frontend..."
npm run build
echo "Frontend build completed"
ls -la ../dist || (echo "dist directory not found in workspace root" && exit 1)
working-directory: web
- name: Verify frontend dist exists
run: |
echo "Checking for dist directory in workspace root..."
ls -la dist || (echo "dist directory not found in workspace root" && exit 1)
- name: Build application
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: src-tauri
args: ${{ matrix.args }}
- name: List bundle files
run: find target -name "bundle" -type d -exec find {} -type f \; || echo "No bundle files found"
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
target/*/release/bundle/macos/*.app
target/*/release/bundle/dmg/*.dmg
target/*/release/bundle/deb/*.deb
target/*/release/bundle/msi/*.msi
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}