Repository navigation
v0.2.0-rc.1 #25
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Bundles | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| linux-bundles: | |
| name: Linux (deb, rpm, appimage, aur) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| src-tauri -> src-tauri/target | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| rpm \ | |
| zip | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Generate icons | |
| run: npm run generate:icons | |
| - name: Install cargo-about | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-about | |
| - name: Generate attribution file | |
| run: bash ./scripts/generate-attributions.sh | |
| - name: Resolve build version | |
| run: | | |
| RAW_VERSION="${{ github.event.release.tag_name || github.ref_name }}" | |
| if [[ -z "$RAW_VERSION" || "$RAW_VERSION" == refs/* ]]; then | |
| RAW_VERSION="${GITHUB_REF_NAME}" | |
| fi | |
| if [[ "$RAW_VERSION" =~ ^v[0-9] ]]; then | |
| BUNDLE_VERSION="${RAW_VERSION#v}" | |
| else | |
| BUNDLE_VERSION="0.1.0" | |
| fi | |
| echo "BUNDLE_VERSION=${BUNDLE_VERSION}" >> "$GITHUB_ENV" | |
| echo "Using BUNDLE_VERSION=${BUNDLE_VERSION}" | |
| - name: Build Tauri Linux bundles and updater metadata | |
| uses: tauri-apps/tauri-action@v0.6.2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| APP_VERSION: ${{ env.BUNDLE_VERSION }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| releaseId: ${{ github.event_name == 'release' && github.event.release.id || '' }} | |
| tagName: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }} | |
| projectPath: ./ | |
| tauriScript: npm run tauri | |
| includeUpdaterJson: true | |
| args: >- | |
| --bundles deb,rpm,appimage | |
| --config '{"version":"${{ env.BUNDLE_VERSION }}"}' | |
| - name: Prepare AUR files | |
| env: | |
| REPO_SLUG: ${{ github.repository }} | |
| SERVER_URL: ${{ github.server_url }} | |
| run: bash ./scripts/generate-aur-package.sh | |
| - name: Validate generated AUR metadata | |
| run: | | |
| if grep -q "owner/repo" packaging/aur/PKGBUILD packaging/aur/.SRCINFO; then | |
| echo "AUR metadata still contains owner/repo placeholder." >&2 | |
| exit 1 | |
| fi | |
| expected_prefix="${{ github.server_url }}/${{ github.repository }}/releases/download/v" | |
| if ! grep -q "$expected_prefix" packaging/aur/PKGBUILD; then | |
| echo "PKGBUILD source URL does not match expected repository release path." >&2 | |
| exit 1 | |
| fi | |
| if ! grep -q "$expected_prefix" packaging/aur/.SRCINFO; then | |
| echo ".SRCINFO source URL does not match expected repository release path." >&2 | |
| exit 1 | |
| fi | |
| - name: Package AUR files | |
| run: | | |
| mkdir -p src-tauri/target/release/bundle/aur | |
| ZIP_NAME="gitmun-aur-${BUNDLE_VERSION}.zip" | |
| ( | |
| cd packaging/aur | |
| zip -9 -j "../../src-tauri/target/release/bundle/aur/${ZIP_NAME}" \ | |
| PKGBUILD \ | |
| .SRCINFO \ | |
| *.install | |
| ) | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: linux-bundles | |
| path: | | |
| src-tauri/target/release/bundle/deb/*.deb | |
| src-tauri/target/release/bundle/rpm/*.rpm | |
| src-tauri/target/release/bundle/appimage/*.AppImage | |
| src-tauri/target/release/bundle/appimage/*.sig | |
| src-tauri/target/release/bundle/aur/*.zip | |
| public/ATTRIBUTIONS.html | |
| - name: Attach AUR bundle to release | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| TOKEN: ${{ github.token }} | |
| RELEASE_ID: ${{ github.event.release.id }} | |
| RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} | |
| REF_NAME: ${{ github.ref_name }} | |
| REPOSITORY: ${{ github.repository }} | |
| run: | | |
| set -euo pipefail | |
| TAG_NAME="${RELEASE_TAG_NAME:-${REF_NAME:-}}" | |
| if [ -z "${RELEASE_ID:-}" ]; then | |
| echo "No release found for tag '${TAG_NAME}'. Skipping asset attachment." | |
| exit 0 | |
| fi | |
| upload_asset() { | |
| local file="$1" | |
| local name | |
| name="$(basename "$file")" | |
| local encoded | |
| encoded="$(python -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))' "$name")" | |
| local upload_url="https://uploads.github.com/repos/${REPOSITORY}/releases/${RELEASE_ID}/assets?name=${encoded}" | |
| curl -fsS -X POST \ | |
| -H "Authorization: Bearer ${TOKEN}" \ | |
| -H "Content-Type: application/octet-stream" \ | |
| --data-binary "@${file}" \ | |
| "$upload_url" | |
| } | |
| shopt -s nullglob | |
| FILES=( | |
| src-tauri/target/release/bundle/aur/*.zip | |
| public/ATTRIBUTIONS.html | |
| ) | |
| for file in "${FILES[@]}"; do | |
| echo "Uploading ${file}" | |
| upload_asset "$file" | |
| done | |
| flatpak-bundle: | |
| name: Linux Flatpak bundle | |
| needs: [linux-bundles] | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48 | |
| options: --privileged | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download Linux artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: linux-bundles | |
| path: ./linux-bundles | |
| - name: Prepare Flatpak rootfs from .deb | |
| run: | | |
| set -euo pipefail | |
| shopt -s globstar nullglob | |
| DEB_FILES=(linux-bundles/**/*.deb) | |
| if [ ${#DEB_FILES[@]} -eq 0 ]; then | |
| echo "No .deb files found in downloaded linux-bundles artifact." | |
| echo "Downloaded artifact contents:" | |
| ls -R linux-bundles | |
| exit 1 | |
| fi | |
| DEB_FILE="${DEB_FILES[0]}" | |
| echo "Using .deb artifact: ${DEB_FILE}" | |
| rm -rf packaging/flatpak/rootfs | |
| mkdir -p packaging/flatpak/rootfs | |
| if command -v dpkg-deb >/dev/null 2>&1; then | |
| dpkg-deb -x "$DEB_FILE" packaging/flatpak/rootfs | |
| else | |
| echo "dpkg-deb not found; extracting .deb payload with ar/tar fallback." | |
| DATA_MEMBER="$(ar t "$DEB_FILE" | grep '^data.tar' | head -n1 || true)" | |
| if [ -z "$DATA_MEMBER" ]; then | |
| echo "Unable to locate data.tar* payload in ${DEB_FILE}" >&2 | |
| exit 1 | |
| fi | |
| case "$DATA_MEMBER" in | |
| *.tar) | |
| ar p "$DEB_FILE" "$DATA_MEMBER" | tar -x -f - -C packaging/flatpak/rootfs | |
| ;; | |
| *.tar.gz|*.tgz) | |
| ar p "$DEB_FILE" "$DATA_MEMBER" | tar -x -z -f - -C packaging/flatpak/rootfs | |
| ;; | |
| *.tar.xz) | |
| ar p "$DEB_FILE" "$DATA_MEMBER" | tar -x -J -f - -C packaging/flatpak/rootfs | |
| ;; | |
| *.tar.bz2) | |
| ar p "$DEB_FILE" "$DATA_MEMBER" | tar -x -j -f - -C packaging/flatpak/rootfs | |
| ;; | |
| *.tar.zst) | |
| if command -v zstd >/dev/null 2>&1; then | |
| ar p "$DEB_FILE" "$DATA_MEMBER" | zstd -d -c | tar -x -f - -C packaging/flatpak/rootfs | |
| else | |
| echo "data.tar.zst found, but zstd is unavailable in Flatpak container." >&2 | |
| exit 1 | |
| fi | |
| ;; | |
| *) | |
| echo "Unsupported .deb payload member: ${DATA_MEMBER}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| fi | |
| - name: Build Flatpak bundle | |
| uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
| with: | |
| manifest-path: packaging/flatpak/com.cst8t.gitmun.yml | |
| bundle: gitmun.flatpak | |
| cache-key: flatpak-builder-v1-${{ hashFiles('packaging/flatpak/com.cst8t.gitmun.yml') }} | |
| upload-artifact: true | |
| - name: Stage Flatpak bundle for release upload | |
| run: | | |
| set -euo pipefail | |
| mkdir -p src-tauri/target/release/bundle/flatpak | |
| mv -f gitmun.flatpak src-tauri/target/release/bundle/flatpak/gitmun.flatpak | |
| - name: Upload Flatpak artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: linux-flatpak | |
| path: src-tauri/target/release/bundle/flatpak/*.flatpak | |
| - name: Attach Flatpak bundle to release | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| TOKEN: ${{ github.token }} | |
| RELEASE_ID: ${{ github.event.release.id }} | |
| RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} | |
| REF_NAME: ${{ github.ref_name }} | |
| REPOSITORY: ${{ github.repository }} | |
| run: | | |
| set -euo pipefail | |
| TAG_NAME="${RELEASE_TAG_NAME:-${REF_NAME:-}}" | |
| if [ -z "${RELEASE_ID:-}" ]; then | |
| echo "No release found for tag '${TAG_NAME}'. Skipping asset attachment." | |
| exit 0 | |
| fi | |
| shopt -s nullglob | |
| FILES=(src-tauri/target/release/bundle/flatpak/*.flatpak) | |
| for file in "${FILES[@]}"; do | |
| name="$(basename "$file")" | |
| upload_url="https://uploads.github.com/repos/${REPOSITORY}/releases/${RELEASE_ID}/assets?name=${name}" | |
| echo "Uploading ${file}" | |
| curl -fsS -X POST \ | |
| -H "Authorization: Bearer ${TOKEN}" \ | |
| -H "Content-Type: application/octet-stream" \ | |
| --data-binary "@${file}" \ | |
| "$upload_url" | |
| done | |
| windows-nsis-cross: | |
| name: Windows NSIS (cross-compiled on Linux) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| src-tauri -> src-tauri/target | |
| - name: Install cross-build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| nsis \ | |
| llvm \ | |
| lld \ | |
| clang | |
| - name: Install cargo-xwin | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-xwin | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Generate icons | |
| run: npm run generate:icons | |
| - name: Resolve build version | |
| run: | | |
| RAW_VERSION="${{ github.event.release.tag_name || github.ref_name }}" | |
| if [[ -z "$RAW_VERSION" || "$RAW_VERSION" == refs/* ]]; then | |
| RAW_VERSION="${GITHUB_REF_NAME}" | |
| fi | |
| if [[ "$RAW_VERSION" =~ ^v[0-9] ]]; then | |
| BUNDLE_VERSION="${RAW_VERSION#v}" | |
| else | |
| BUNDLE_VERSION="0.1.0" | |
| fi | |
| echo "BUNDLE_VERSION=${BUNDLE_VERSION}" >> "$GITHUB_ENV" | |
| echo "Using BUNDLE_VERSION=${BUNDLE_VERSION}" | |
| - name: Build Windows NSIS installer and updater metadata | |
| uses: tauri-apps/tauri-action@v0.6.2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| APP_VERSION: ${{ env.BUNDLE_VERSION }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| releaseId: ${{ github.event_name == 'release' && github.event.release.id || '' }} | |
| tagName: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }} | |
| projectPath: ./ | |
| tauriScript: npm run tauri | |
| includeUpdaterJson: true | |
| updaterJsonPreferNsis: true | |
| args: >- | |
| --runner cargo-xwin | |
| --target x86_64-pc-windows-msvc | |
| --config '{"version":"${{ env.BUNDLE_VERSION }}","bundle":{"active":true,"targets":"nsis"}}' | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows-nsis | |
| path: | | |
| src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe | |
| src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.sig | |
| macos-bundles: | |
| name: macOS (dmg, app updater) | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| src-tauri -> src-tauri/target | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Generate icons | |
| run: npm run generate:icons | |
| - name: Resolve build version | |
| run: | | |
| RAW_VERSION="${{ github.event.release.tag_name || github.ref_name }}" | |
| if [[ -z "$RAW_VERSION" || "$RAW_VERSION" == refs/* ]]; then | |
| RAW_VERSION="${GITHUB_REF_NAME}" | |
| fi | |
| if [[ "$RAW_VERSION" =~ ^v[0-9] ]]; then | |
| BUNDLE_VERSION="${RAW_VERSION#v}" | |
| else | |
| BUNDLE_VERSION="0.1.0" | |
| fi | |
| echo "BUNDLE_VERSION=${BUNDLE_VERSION}" >> "$GITHUB_ENV" | |
| echo "Using BUNDLE_VERSION=${BUNDLE_VERSION}" | |
| - name: Build macOS bundles and updater metadata | |
| uses: tauri-apps/tauri-action@v0.6.2 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| APP_VERSION: ${{ env.BUNDLE_VERSION }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| releaseId: ${{ github.event_name == 'release' && github.event.release.id || '' }} | |
| tagName: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }} | |
| projectPath: ./ | |
| tauriScript: npm run tauri | |
| includeUpdaterJson: true | |
| args: >- | |
| --bundles app,dmg | |
| --config '{"version":"${{ env.BUNDLE_VERSION }}"}' | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: macos-bundles | |
| path: | | |
| src-tauri/target/release/bundle/dmg/*.dmg | |
| src-tauri/target/release/bundle/macos/*.app.tar.gz | |
| src-tauri/target/release/bundle/macos/*.sig |