From 6354822a567ca5748d0e429a02d8aa2dc321f274 Mon Sep 17 00:00:00 2001 From: Moritz Reis Date: Sun, 15 Mar 2026 14:55:06 +0100 Subject: [PATCH] feat: add GitHub Actions workflow for releasing Linux bundles --- .github/workflows/release-linux-bundles.yml | 106 ++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 .github/workflows/release-linux-bundles.yml diff --git a/.github/workflows/release-linux-bundles.yml b/.github/workflows/release-linux-bundles.yml new file mode 100644 index 0000000..d2635a4 --- /dev/null +++ b/.github/workflows/release-linux-bundles.yml @@ -0,0 +1,106 @@ +name: Release Linux Bundles + +on: + workflow_dispatch: + inputs: + tag: + description: Existing tag to publish to (optional) + required: false + type: string + push: + tags: + - 'v*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + timeout-minutes: 45 + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: src-tauri + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Setup pnpm + uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c + with: + package_json_file: ./package.json + cache: true + cache_dependency_path: ./pnpm-lock.yaml + + - name: Install Linux dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libwebkit2gtk-4.1-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + patchelf + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build Linux bundles + run: pnpm run tauri build --bundles deb,appimage + + - name: Upload DEB artifact + uses: actions/upload-artifact@v4 + with: + name: linux-deb + path: src-tauri/target/release/bundle/deb/** + + - name: Upload AppImage artifact + uses: actions/upload-artifact@v4 + with: + name: linux-appimage + path: src-tauri/target/release/bundle/appimage/** + + - name: Resolve release tag + id: resolve_tag + shell: bash + run: | + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + tag="${GITHUB_REF#refs/tags/}" + elif [[ -n "${{ inputs.tag }}" ]]; then + tag="${{ inputs.tag }}" + else + tag="v$(node -p "require('./package.json').version")" + fi + + echo "tag=$tag" >> "$GITHUB_OUTPUT" + echo "Using release tag: $tag" + + - name: Publish assets to GitHub Release + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ steps.resolve_tag.outputs.tag }} + shell: bash + run: | + shopt -s nullglob + + files=(src-tauri/target/release/bundle/deb/*.deb src-tauri/target/release/bundle/appimage/*.AppImage) + if [[ ${#files[@]} -eq 0 ]]; then + echo "No Linux bundle files found to upload." + exit 1 + fi + + if ! gh release view "$RELEASE_TAG" >/dev/null 2>&1; then + gh release create "$RELEASE_TAG" --generate-notes + fi + + gh release upload "$RELEASE_TAG" "${files[@]}" --clobber