-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 2.64 KB
/
Copy pathrelease-linux.yml
File metadata and controls
89 lines (72 loc) · 2.64 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
name: Release Linux Installers
on:
release:
types: [published]
push:
branches:
- main
jobs:
build-linux-installers:
name: Build Linux CLI & GUI
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev patchelf libayatana-appindicator3-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "release"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build CLI Standalone
run: cargo build --release -p bonsize-cli
- name: Build Tauri GUI
working-directory: ./bonsize-tauri
run: |
bun install
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
bun run tauri build
else
bun run tauri build --no-bundle
fi
- name: Install cargo-deb
if: startsWith(github.ref, 'refs/tags/')
run: cargo install cargo-deb
- name: Package CLI Standalone
if: startsWith(github.ref, 'refs/tags/')
run: cargo deb -p bonsize-cli --no-build
- name: Build Combined Suite
if: startsWith(github.ref, 'refs/tags/')
run: cargo deb -p bonsize-installer --no-build
- name: Rename Release Assets
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p release-assets
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
# Move CLI .deb
mv target/debian/bonsize_*.deb release-assets/bonsize-${VERSION}-amd64-CLI.deb
# Create a standalone universal tar.gz for the CLI
tar -czvf release-assets/bonsize-${VERSION}-amd64-linux.tar.gz -C target/release bonsize
# Move ALL (installer) .deb
mv target/debian/bonsize-gui-and-cli_*.deb release-assets/bonsize-${VERSION}-amd64-ALL.deb
# Move GUI (Tauri) .deb & .AppImage
mv target/release/bundle/deb/*.deb release-assets/bonsize-${VERSION}-amd64-GUI.deb
mv target/release/bundle/appimage/*.AppImage release-assets/bonsize-${VERSION}-amd64-GUI.AppImage
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-assets/*