release: v0.2.3 - Editor Productivity and Platform Polish #10
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: 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 | |
| build-linux-musl: | |
| name: Build Linux (musl static) | |
| runs-on: ubuntu-latest | |
| # GUI apps with OpenGL/GTK deps may fail with musl - don't block release | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust with musl target | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-musl | |
| - name: Install musl-tools and dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools musl-dev pkg-config | |
| - name: Build release (musl static) | |
| run: cargo build --release --target x86_64-unknown-linux-musl | |
| env: | |
| CC_x86_64_unknown_linux_musl: musl-gcc | |
| PKG_CONFIG_ALLOW_CROSS: "1" | |
| RUSTFLAGS: "-C target-feature=+crt-static" | |
| - name: Verify static linking | |
| run: | | |
| file target/x86_64-unknown-linux-musl/release/ferrite | |
| ldd target/x86_64-unknown-linux-musl/release/ferrite || echo "Binary is statically linked (expected)" | |
| - name: Create release archive | |
| run: | | |
| mkdir release | |
| cp target/x86_64-unknown-linux-musl/release/ferrite release/ | |
| tar -czvf ferrite-linux-musl-x64.tar.gz -C release . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ferrite-linux-musl-x64 | |
| path: ferrite-linux-musl-x64.tar.gz | |
| # Create GitHub Release with all artifacts | |
| release: | |
| name: Create Release | |
| needs: [build-windows, build-linux, build-linux-musl, 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 musl artifact | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true # musl build may have failed | |
| with: | |
| name: ferrite-linux-musl-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 | |
| fail_on_unmatched_files: false # musl artifact may not exist | |
| files: | | |
| ferrite-windows-x64.zip | |
| ferrite-linux-x64.tar.gz | |
| ferrite-linux-musl-x64.tar.gz | |
| ferrite-editor_amd64.deb | |
| ferrite-macos-arm64.tar.gz | |
| ferrite-macos-x64.tar.gz |