a2fuse 0.1.3

Mount and maintain Apple II ProDOS disk images
Documentation
name: Release

on:
  push:
    tags:
      - "v*"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: false

permissions:
  contents: write

jobs:
  build:
    name: Build (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            artifact_prefix: a2fuse-linux
          - os: macos-latest
            artifact_prefix: a2fuse-macos

    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache Rust build artifacts
        uses: Swatinem/rust-cache@v2

      - name: Build release binary
        run: cargo build --locked --release

      - name: Package release binary
        run: |
          mkdir -p dist
          tar -czf "dist/${{ matrix.artifact_prefix }}-${{ runner.arch }}.tar.gz" -C target/release a2fuse

      - name: Upload release artifact
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.artifact_prefix }}-${{ runner.arch }}
          path: dist/${{ matrix.artifact_prefix }}-${{ runner.arch }}.tar.gz
          if-no-files-found: error

  publish:
    name: Publish release
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Download build artifacts
        uses: actions/download-artifact@v4
        with:
          path: dist
          merge-multiple: true

      - name: Create GitHub release
        uses: softprops/action-gh-release@v2
        with:
          files: dist/*.tar.gz
          generate_release_notes: true