-
Notifications
You must be signed in to change notification settings - Fork 57
100 lines (86 loc) · 3.1 KB
/
build.yaml
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
name: Build
on:
workflow_call:
inputs:
version-number:
type: string
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# MacOS (Intel & Apple Silicon)
- platform: macos-latest
rust-targets: x86_64-apple-darwin,aarch64-apple-darwin
tauri-target: universal-apple-darwin
# 64-bit Linux
- platform: ubuntu-22.04
rust-targets: x86_64-unknown-linux-gnu
tauri-target: x86_64-unknown-linux-gnu
# 64-bit Windows (Intel & AMD)
- platform: windows-latest
rust-targets: x86_64-pc-windows-msvc
tauri-target: x86_64-pc-windows-msvc
# 64-bit Windows (ARM)
- platform: windows-latest
rust-targets: aarch64-pc-windows-msvc
tauri-target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17
with:
toolchain: nightly
targets: ${{ matrix.rust-targets }}
- uses: swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
with:
shared-key: ${{ matrix.tauri-target }}-${{ hashFiles('Cargo.lock') }}
- name: Install dependencies (Ubuntu)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install dependencies (Windows)
if: matrix.platform == 'windows-latest'
run: |
dotnet tool install --global AzureSignTool --version 5.0.0
- run: pnpm i
- run: pnpm run --filter zebar --filter @zebar/client build
- name: Set version number
run: |
jq '.version="${{ inputs.version-number || '0.0.0' }}"' packages/desktop/tauri.conf.json
- name: Tauri build
uses: tauri-apps/tauri-action@v0
id: tauri
env:
AZ_VAULT_URL: ${{ secrets.AZ_VAULT_URL }}
AZ_CERT_NAME: ${{ secrets.AZ_CERT_NAME }}
AZ_CLIENT_ID: ${{ secrets.AZ_CLIENT_ID }}
AZ_CLIENT_SECRET: ${{ secrets.AZ_CLIENT_SECRET }}
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
RFC3161_TIMESTAMP_URL: ${{ vars.RFC3161_TIMESTAMP_URL }}
with:
projectPath: packages/desktop
args: --target ${{ matrix.tauri-target }}
- name: Move & rename artifacts
run: |
mkdir tmp
ARTIFACTS='${{ steps.tauri.outputs.artifactPaths }}'
for ARTIFACT in $(echo "$ARTIFACTS" | jq -r '.[]'); do
mv "$ARTIFACT" "tmp/tauri.${ARTIFACT##*.}"
done
shell: bash
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: bundle-${{ matrix.tauri-target }}
if-no-files-found: error
path: tmp