name: Build and Release on: push: branches: - main tags: - 'v*' pull_request: branches: - main env: CARGO_TERM_COLOR: always jobs: test: name: Test runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Bun uses: https://github.com/oven-sh/setup-bun@v1 with: bun-version: latest - name: Install Node dependencies run: bun install - name: Run type check run: bun run check - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@stable - name: Cache Rust dependencies uses: https://github.com/Swatinem/rust-cache@v2 with: workspaces: src-tauri - name: Check Rust formatting run: cargo fmt --check --manifest-path src-tauri/Cargo.toml - name: Run Rust clippy run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings build-windows: name: Build Windows runs-on: windows-latest needs: test if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Bun uses: https://github.com/oven-sh/setup-bun@v1 with: bun-version: latest - name: Install dependencies run: bun install - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@stable - name: Cache Rust dependencies uses: https://github.com/Swatinem/rust-cache@v2 with: workspaces: src-tauri - name: Build Tauri app run: bun tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Upload Windows artifacts uses: https://github.com/actions/upload-artifact@v4 with: name: windows-artifacts path: | src-tauri/target/release/bundle/msi/*.msi src-tauri/target/release/bundle/msi/*.msi.zip src-tauri/target/release/bundle/msi/*.msi.zip.sig src-tauri/target/release/bundle/nsis/*.exe build-linux: name: Build Linux runs-on: ubuntu-latest needs: test if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Bun uses: https://github.com/oven-sh/setup-bun@v1 with: bun-version: latest - name: Install dependencies run: bun install - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@stable - name: Cache Rust dependencies uses: https://github.com/Swatinem/rust-cache@v2 with: workspaces: src-tauri - name: Install system dependencies run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev \ build-essential \ curl \ wget \ file \ libxdo-dev \ libssl-dev \ libayatana-appindicator3-dev \ librsvg2-dev - name: Build Tauri app run: bun tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Upload Linux artifacts uses: https://github.com/actions/upload-artifact@v4 with: name: linux-artifacts path: | src-tauri/target/release/bundle/deb/*.deb src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz src-tauri/target/release/bundle/appimage/*.AppImage.tar.gz.sig build-macos: name: Build macOS runs-on: macos-latest needs: test if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Bun uses: https://github.com/oven-sh/setup-bun@v1 with: bun-version: latest - name: Install dependencies run: bun install - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@stable with: targets: aarch64-apple-darwin,x86_64-apple-darwin - name: Cache Rust dependencies uses: https://github.com/Swatinem/rust-cache@v2 with: workspaces: src-tauri - name: Build Tauri app (Universal) run: bun tauri build --target universal-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Upload macOS artifacts uses: https://github.com/actions/upload-artifact@v4 with: name: macos-artifacts path: | src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz.sig release: name: Create Release runs-on: ubuntu-latest needs: [build-windows, build-linux, build-macos] if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code uses: actions/checkout@v4 - name: Download all artifacts uses: https://github.com/actions/download-artifact@v4 with: path: artifacts - name: Get version from tag id: get_version run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - name: Generate release notes id: release_notes run: | echo "NOTES<> $GITHUB_OUTPUT git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Create latest.json for updater run: | cat > latest.json << EOF { "version": "${{ steps.get_version.outputs.VERSION }}", "notes": "${{ steps.release_notes.outputs.NOTES }}", "pub_date": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", "platforms": { "windows-x86_64": { "signature": "$(cat artifacts/windows-artifacts/*.msi.zip.sig)", "url": "https://git.sirblob.co/${{ github.repository }}/releases/download/v${{ steps.get_version.outputs.VERSION }}/gitea-desktop_${{ steps.get_version.outputs.VERSION }}_x64_en-US.msi.zip" }, "linux-x86_64": { "signature": "$(cat artifacts/linux-artifacts/*.AppImage.tar.gz.sig)", "url": "https://git.sirblob.co/${{ github.repository }}/releases/download/v${{ steps.get_version.outputs.VERSION }}/gitea-desktop_${{ steps.get_version.outputs.VERSION }}_amd64.AppImage.tar.gz" }, "darwin-universal": { "signature": "$(cat artifacts/macos-artifacts/*.app.tar.gz.sig)", "url": "https://git.sirblob.co/${{ github.repository }}/releases/download/v${{ steps.get_version.outputs.VERSION }}/gitea-desktop_${{ steps.get_version.outputs.VERSION }}_universal.app.tar.gz" } } } EOF - name: Create Release uses: https://github.com/softprops/action-gh-release@v1 with: name: Release v${{ steps.get_version.outputs.VERSION }} body: | ## What's Changed ${{ steps.release_notes.outputs.NOTES }} ## Downloads - **Windows**: `.msi` installer - **Linux**: `.deb` or `.AppImage` - **macOS**: `.dmg` or `.app` ## Installation Download the appropriate file for your platform and install it. files: | artifacts/windows-artifacts/* artifacts/linux-artifacts/* artifacts/macos-artifacts/* latest.json draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} dev-build: name: Development Build runs-on: windows-latest if: github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Bun uses: https://github.com/oven-sh/setup-bun@v1 with: bun-version: latest - name: Install dependencies run: bun install - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@stable - name: Cache Rust dependencies uses: https://github.com/Swatinem/rust-cache@v2 with: workspaces: src-tauri - name: Build Tauri app (dev) run: bun tauri build --debug - name: Upload dev build uses: https://github.com/actions/upload-artifact@v4 with: name: dev-build-windows path: | src-tauri/target/debug/bundle/**/* retention-days: 7