-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (86 loc) · 3.09 KB
/
build-artifacts.yml
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
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: Build Artifacts
on:
pull_request:
paths:
- '.github/workflows/build-artifacts.yml'
- '**'
workflow_dispatch:
jobs:
build-artifacs:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: install libs (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libusb-1.0-0 libudev-dev
- name: Rust setup
uses: dtolnay/rust-toolchain@nightly
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm' # Set this to npm, yarn or pnpm.
- name: Install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install --no-frozen-lockfile # Change this to npm, yarn or pnpm.
- name: build artifacts
if: matrix.platform != 'macos-latest'
working-directory: ./
run: |
pnpm run tauri build
- name: build artifacts (MacOS)
if: matrix.platform == 'macos-latest'
working-directory: ./
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
pnpm run tauri build --target universal-apple-darwin
- uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-20.04'
with:
name: linux-deb
path: ./src-tauri/target/release/bundle/deb/*.deb
- uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-20.04'
with:
name: linux-appimage
path: ./src-tauri/target/release/bundle/appimage/*.AppImage
- uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: windows-exe
path: ./src-tauri/target/release/*.exe
- uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: windows-msi
path: ./src-tauri/target/release/bundle/msi/*
- uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: macos-app
path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
- uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: macos-dmg
path: ./src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg