Release #14
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
| # Release workflow - builds and publishes when a version tag is pushed | |
| # Usage: git tag v0.1.0 && git push --tags | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build release | |
| run: cargo build --release | |
| - name: Create release archive | |
| run: | | |
| mkdir release | |
| copy target\release\ferrite.exe release\ | |
| Compress-Archive -Path release\* -DestinationPath ferrite-windows-x64.zip | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-windows-x64 | |
| path: ferrite-windows-x64.zip | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-22.04 # Use 22.04 for wider glibc compatibility | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libxcb-shape0-dev libxcb-xfixes0-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-deb | |
| run: cargo install cargo-deb | |
| - name: Build release | |
| run: cargo build --release | |
| - name: Create release archive | |
| run: | | |
| mkdir release | |
| cp target/release/ferrite release/ | |
| tar -czvf ferrite-linux-x64.tar.gz -C release . | |
| - name: Build .deb package | |
| run: cargo deb --no-build | |
| - name: Copy .deb to workspace root | |
| run: cp target/debian/*.deb ./ferrite-editor_amd64.deb | |
| - name: Upload tar.gz artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-linux-x64 | |
| path: ferrite-linux-x64.tar.gz | |
| - name: Upload .deb artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-linux-deb | |
| path: ferrite-editor_amd64.deb | |
| build-macos-arm64: | |
| name: Build macOS (Apple Silicon) | |
| runs-on: macos-latest # macos-latest is ARM64 (Apple Silicon) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Generate macOS .icns icon | |
| run: | | |
| if [ -d "assets/icons/macos/app.iconset" ]; then | |
| iconutil -c icns assets/icons/macos/app.iconset -o assets/icons/macos/app.icns | |
| echo "Generated app.icns" | |
| else | |
| echo "Warning: app.iconset not found, skipping .icns generation" | |
| fi | |
| - name: Build release | |
| run: cargo build --release | |
| - name: Create release archive | |
| run: | | |
| mkdir release | |
| cp target/release/ferrite release/ | |
| tar -czvf ferrite-macos-arm64.tar.gz -C release . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-macos-arm64 | |
| path: ferrite-macos-arm64.tar.gz | |
| build-macos-intel: | |
| name: Build macOS (Intel) | |
| runs-on: macos-14 # Cross-compile to x86_64 from ARM64 runner | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust with Intel target | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-apple-darwin | |
| - name: Build release for Intel | |
| run: cargo build --release --target x86_64-apple-darwin | |
| - name: Create release archive | |
| run: | | |
| mkdir release | |
| cp target/x86_64-apple-darwin/release/ferrite release/ | |
| tar -czvf ferrite-macos-x64.tar.gz -C release . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-macos-x64 | |
| path: ferrite-macos-x64.tar.gz | |
| # NOTE: musl static build disabled - GUI apps with font rendering (freetype, fontconfig) | |
| # and graphics (X11/Wayland) dependencies cannot be easily built as static musl binaries. | |
| # The glibc build (Ubuntu 22.04) provides good compatibility across Linux distributions. | |
| # Create GitHub Release with all artifacts | |
| release: | |
| name: Create Release | |
| needs: [build-windows, build-linux, build-macos-arm64, build-macos-intel] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ferrite-windows-x64 | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ferrite-linux-x64 | |
| - name: Download Linux .deb artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ferrite-linux-deb | |
| - name: Download macOS ARM64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ferrite-macos-arm64 | |
| - name: Download macOS Intel artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ferrite-macos-x64 | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Ferrite ${{ github.ref_name }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| generate_release_notes: true | |
| files: | | |
| ferrite-windows-x64.zip | |
| ferrite-linux-x64.tar.gz | |
| ferrite-editor_amd64.deb | |
| ferrite-macos-arm64.tar.gz | |
| ferrite-macos-x64.tar.gz |