-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (89 loc) · 2.39 KB
/
release.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
name: Release
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
linux:
name: Build for Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y
libwebkit2gtk-4.0-dev
build-essential
curl
wget
file
libssl-dev
libgtk-3-dev
libayatana-appindicator3-dev
librsvg2-dev
- name: Build
working-directory: ./src-tauri
run: cargo build --verbose
- name: Run tests
working-directory: ./chusst-gen
run: cargo test --verbose
- name: Install React dependencies
run: npm install
if: startsWith(github.ref, 'refs/tags/')
- name: Install Rust dependencies
run: cargo install tauri-cli
if: startsWith(github.ref, 'refs/tags/')
- name: Build
working-directory: ./src-tauri
run: cargo tauri build -b deb
if: startsWith(github.ref, 'refs/tags/')
- name: Upload artifact
uses: actions/upload-artifact@v3
if: startsWith(github.ref, 'refs/tags/')
with:
name: linux
path: ./target/release/bundle/deb/chusst_*.deb
macos:
name: Build for macOS
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Build
working-directory: ./src-tauri
run: cargo build --verbose
- name: Run tests
working-directory: ./chusst-gen
run: cargo test --verbose
- name: Install React dependencies
run: npm install
- name: Install Rust dependencies
run: cargo install tauri-cli
- name: Build
working-directory: ./src-tauri
run: cargo tauri build -b dmg
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: macos
path: ./target/release/bundle/dmg/chusst_*.dmg
release:
name: Create release
runs-on: ubuntu-latest
needs:
- linux
- macos
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./linux/chusst_*.deb
./macos/chusst_*.dmg