Skip to content

Commit 68daadc

Browse files
committed
chore: add GitHub Actions workflow
1 parent c6db040 commit 68daadc

1 file changed

Lines changed: 182 additions & 0 deletions

File tree

.github/workflows/workflow2.yml

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
name: Build ZFileTimeMachine Artifacts
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
14+
build-linux:
15+
name: Linux x86_64
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: '10'
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '24'
27+
cache: 'pnpm'
28+
29+
- uses: dtolnay/rust-toolchain@stable
30+
31+
- uses: swatinem/rust-cache@v2
32+
with:
33+
workspaces: './src-tauri -> target'
34+
35+
- name: Install system dependencies
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y \
39+
libwebkit2gtk-4.1-dev \
40+
libayatana-appindicator3-dev \
41+
librsvg2-dev \
42+
patchelf
43+
44+
- run: pnpm install
45+
46+
- id: build
47+
uses: tauri-apps/tauri-action@v0
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
args: --bundles appimage,deb,rpm
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: artifacts-linux
56+
path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}"
57+
if-no-files-found: error
58+
59+
build-windows:
60+
name: Windows x64
61+
runs-on: windows-2025
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- uses: pnpm/action-setup@v4
66+
with:
67+
version: '10'
68+
69+
- uses: actions/setup-node@v4
70+
with:
71+
node-version: '24'
72+
cache: 'pnpm'
73+
74+
- uses: dtolnay/rust-toolchain@stable
75+
76+
- uses: swatinem/rust-cache@v2
77+
with:
78+
workspaces: './src-tauri -> target'
79+
80+
- run: pnpm install
81+
82+
- id: build
83+
uses: tauri-apps/tauri-action@v0
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
args: --bundles nsis,msi
88+
89+
- uses: actions/upload-artifact@v4
90+
with:
91+
name: artifacts-windows
92+
path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}"
93+
if-no-files-found: error
94+
95+
build-macos-arm:
96+
name: macOS Apple Silicon
97+
runs-on: macos-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- uses: pnpm/action-setup@v4
102+
with:
103+
version: '10'
104+
105+
- uses: actions/setup-node@v4
106+
with:
107+
node-version: '24'
108+
cache: 'pnpm'
109+
110+
- uses: dtolnay/rust-toolchain@stable
111+
with:
112+
targets: aarch64-apple-darwin
113+
114+
- uses: swatinem/rust-cache@v2
115+
with:
116+
workspaces: './src-tauri -> target'
117+
118+
- run: pnpm install
119+
120+
- id: build
121+
uses: tauri-apps/tauri-action@v0
122+
env:
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
with:
125+
args: --bundles dmg --target aarch64-apple-darwin
126+
127+
- uses: actions/upload-artifact@v4
128+
with:
129+
name: artifacts-macos-arm
130+
path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}"
131+
if-no-files-found: error
132+
133+
build-macos-intel:
134+
name: macOS Intel x64
135+
runs-on: macos-latest
136+
steps:
137+
- uses: actions/checkout@v4
138+
139+
- uses: pnpm/action-setup@v4
140+
with:
141+
version: '10'
142+
143+
- uses: actions/setup-node@v4
144+
with:
145+
node-version: '24'
146+
cache: 'pnpm'
147+
148+
- uses: dtolnay/rust-toolchain@stable
149+
with:
150+
targets: x86_64-apple-darwin
151+
152+
- uses: swatinem/rust-cache@v2
153+
with:
154+
workspaces: './src-tauri -> target'
155+
156+
- run: pnpm install
157+
158+
- id: build
159+
uses: tauri-apps/tauri-action@v0
160+
env:
161+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162+
with:
163+
args: --bundles dmg --target x86_64-apple-darwin
164+
165+
- uses: actions/upload-artifact@v4
166+
with:
167+
name: artifacts-macos-intel
168+
path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}"
169+
if-no-files-found: error
170+
171+
collect-artifacts:
172+
name: Collect all release artifacts
173+
needs: [build-linux, build-windows, build-macos-arm, build-macos-intel]
174+
runs-on: ubuntu-24.04
175+
steps:
176+
- uses: actions/download-artifact@v4
177+
with:
178+
path: dist/
179+
merge-multiple: true
180+
181+
- name: List artifacts
182+
run: find dist/ -type f | sort

0 commit comments

Comments
 (0)