-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (102 loc) · 3.17 KB
/
Copy pathrelease.yml
File metadata and controls
115 lines (102 loc) · 3.17 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
112
113
114
115
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Existing v* tag to build"
required: true
type: string
platform:
description: "Platform to build"
required: true
default: Windows
type: choice
options:
- Windows
- macOS
- Linux
- all
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
SHOULD_BUILD: ${{ github.event_name == 'push' || inputs.platform == 'all' || inputs.platform == matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-latest
artifact-name: command-deck-macos
bundles: dmg
artifact-path: |
src-tauri/target/release/bundle/dmg/*.dmg
- name: Linux
os: ubuntu-22.04
artifact-name: command-deck-linux
bundles: appimage,deb
artifact-path: |
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/deb/*.deb
- name: Windows
os: windows-latest
artifact-name: command-deck-windows
bundles: nsis
artifact-path: |
src-tauri/target/release/bundle/nsis/*.exe
steps:
- name: Check out repository
if: env.SHOULD_BUILD == 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
- name: Install Linux dependencies
if: env.SHOULD_BUILD == 'true' && runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: Set up Node
if: env.SHOULD_BUILD == 'true'
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Set up Rust
if: env.SHOULD_BUILD == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
if: env.SHOULD_BUILD == 'true'
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install frontend dependencies
if: env.SHOULD_BUILD == 'true'
run: npm ci
- name: Build Tauri app
if: env.SHOULD_BUILD == 'true'
run: npm run tauri build -- --bundles ${{ matrix.bundles }}
- name: Upload build artifact
if: env.SHOULD_BUILD == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}
if-no-files-found: error
- name: Attach assets to GitHub release
if: env.SHOULD_BUILD == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
files: ${{ matrix.artifact-path }}
generate_release_notes: true
overwrite_files: true