Repository navigation
135 lines (112 loc) · 4.02 KB
/
Copy pathrelease-linux.yml
File metadata and controls
135 lines (112 loc) · 4.02 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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: Upload GUI binary (for Flatpak)
uses: actions/upload-artifact@v4
with:
name: bonsize-gui-bin
path: target/release/bonsize-gui
- 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/*
build-flatpak:
name: Build Flatpak GUI
needs: build-linux-installers
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download GUI binary
uses: actions/download-artifact@v4
with:
name: bonsize-gui-bin
path: target/release
- name: Build Flatpak bundle
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: bonsize-gui.flatpak
manifest-path: flatpak/com.bonsize.ui.yml
cache-key: flatpak-builder-${{ github.sha }}
- name: Rename Flatpak bundle
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
mkdir -p release-assets
mv bonsize-gui.flatpak release-assets/bonsize-${VERSION}-x86_64-GUI.flatpak
- name: Upload Flatpak to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-assets/*