-
Notifications
You must be signed in to change notification settings - Fork 7
108 lines (97 loc) · 3.16 KB
/
cd.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
105
106
107
108
name: Continuous Deployment
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: Publish on GitHub
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
target: x86_64-apple-darwin
- build: windows
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install \
--allow-unauthenticated -y -qq \
libgtk-3-dev \
webkit2gtk-4.0 \
libappindicator3-dev \
librsvg2-dev patchelf
- name: Install node
uses: actions/setup-node@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
profile: minimal
- name: Build CLI
working-directory: cli
shell: bash
run: |
cargo build --verbose --locked \
--release --target ${{ matrix.target }}
- name: Build GUI
working-directory: gui
shell: bash
run: |
yarn install --ignore-engines
yarn tauri info
CI=true yarn tauri build --target ${{ matrix.target }}
- name: Prepare artifacts [Unix]
shell: bash
if: matrix.os != 'windows-latest'
run: |
release_dir="spicy-launcher"
mkdir $release_dir
for bin in 'spicy-launcher' 'spicy-launcher-cli'; do
cp "target/${{ matrix.target }}/release/$bin" $release_dir/
done
tar -czvf "spicy-launcher-${{ matrix.build }}.tar.gz" $release_dir/
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
bundles=("deb" "AppImage")
else
bundles=("app" "dmg")
fi
for bundle in "${bundles[@]}"; do
mv "target/${{ matrix.target }}/release"/bundle/*/spicy-launcher*.$bundle \
"spicy-launcher-${{ matrix.build }}.$bundle"
done
- name: Prepare artifacts [Windows]
shell: bash
if: matrix.os == 'windows-latest'
run: |
release_dir="spicy-launcher"
mkdir $release_dir
for bin in 'spicy-launcher.exe' 'spicy-launcher-cli.exe'; do
cp "target/${{ matrix.target }}/release/$bin" $release_dir/
done
7z a -tzip "spicy-launcher-${{ matrix.build }}.zip" $release_dir/
mv "target/${{ matrix.target }}/release"/bundle/*/spicy-launcher*.msi \
"spicy-launcher-${{ matrix.build }}.msi"
- name: Publish release
uses: svenstaro/upload-release-action@v2
with:
file: spicy-launcher-${{ matrix.build }}*
file_glob: true
overwrite: true
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}