Skip to content

Commit f96ac4f

Browse files
committed
Setup vault-desktop CI
1 parent 27c33ba commit f96ac4f

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: build-vault-desktop
2+
3+
on: push
4+
5+
jobs:
6+
build-vault-desktop:
7+
permissions:
8+
contents: write
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
settings:
13+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
14+
args: '--target aarch64-apple-darwin'
15+
- platform: 'macos-latest' # for Intel based macs.
16+
args: '--target x86_64-apple-darwin'
17+
- platform: 'ubuntu-20.04'
18+
args: ''
19+
- platform: 'windows-latest'
20+
args: ''
21+
22+
runs-on: ${{ matrix.settings.platform }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install OS dependencies
27+
if: matrix.settings.platform == 'ubuntu-20.04'
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
31+
32+
- name: Setup node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: lts/*
36+
cache: 'npm'
37+
cache-dependency-path: |
38+
vault-web/package-lock.json
39+
vault-desktop/package-lock.json
40+
41+
- name: Install Rust
42+
uses: dtolnay/rust-toolchain@stable
43+
with:
44+
toolchain: "1.75.0"
45+
targets: wasm32-unknown-unknown ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
46+
47+
- name: Install wasm-pack
48+
run: |
49+
npm install -g wasm-pack@0.12.1
50+
51+
- name: Rust cache
52+
uses: swatinem/rust-cache@v2
53+
with:
54+
workspaces: './src-tauri -> target'
55+
56+
- name: Install frontend dependencies
57+
run: |
58+
cd vault-web
59+
npm install
60+
cd ..
61+
cd vault-desktop
62+
npm install
63+
64+
- name: Generate TypeScript definitions
65+
run: |
66+
cd vault-wasm
67+
# we can use --dev to speed things up. we don't use the generated wasm file, just the .d.ts files
68+
wasm-pack build --target web --out-dir ../vault-web/src/vault-wasm --out-name vault-wasm --dev
69+
70+
- uses: tauri-apps/tauri-action@v0
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
projectPath: vault-desktop
75+
tauriScript: npm run tauri
76+
tagName: vault-desktop-v__VERSION__
77+
releaseName: 'vault-desktop v__VERSION__'
78+
releaseBody: 'See the assets to download this version and install.'
79+
releaseDraft: true
80+
prerelease: false
81+
args: ${{ matrix.settings.args }}
File renamed without changes.

0 commit comments

Comments
 (0)