redox-editor 0.6.0

A terminal-based, Vim-like text editor built with MinUI
name: Release

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: write

env:
  CARGO_TERM_COLOR: always

jobs:
  build-binaries:
    name: Build (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            artifact_suffix: linux
            archive_ext: tar.gz
          - os: macos-latest
            artifact_suffix: macos
            archive_ext: tar.gz

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable

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

      - name: Build release binary
        run: cargo build --release --locked -p redox-editor

      - name: Prepare archive
        run: |
          set -euo pipefail
          mkdir -p dist
          cp target/release/redox dist/redox
          tar -C dist -czf redox-${{ github.ref_name }}-${{ matrix.artifact_suffix }}-${{ runner.arch }}.${{ matrix.archive_ext }} redox

      - name: Upload packaged binary
        uses: actions/upload-artifact@v4
        with:
          name: redox-${{ matrix.artifact_suffix }}-${{ runner.arch }}
          path: redox-${{ github.ref_name }}-${{ matrix.artifact_suffix }}-${{ runner.arch }}.${{ matrix.archive_ext }}

  github-release:
    name: Create GitHub Release
    runs-on: ubuntu-latest
    needs: build-binaries

    steps:
      - name: Download artifacts
        uses: actions/download-artifact@v4
        with:
          path: dist

      - name: Publish release
        uses: softprops/action-gh-release@v2
        with:
          generate_release_notes: true
          files: dist/**/*