jemdoc-rs 0.8.0

A Rust rewrite of jemdoc, a light text-based markup language for creating static websites.
name: Release

on:
  push:
    tags:
      - "v*"

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build (${{ matrix.target }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            binary: jemdoc-rs
            asset: jemdoc-rs-linux-x86_64
          - target: x86_64-apple-darwin
            os: macos-latest
            binary: jemdoc-rs
            asset: jemdoc-rs-macos-x86_64
          - target: aarch64-apple-darwin
            os: macos-latest
            binary: jemdoc-rs
            asset: jemdoc-rs-macos-aarch64
          - target: x86_64-pc-windows-msvc
            os: windows-latest
            binary: jemdoc-rs.exe
            asset: jemdoc-rs-windows-x86_64.exe

    steps:
      - uses: actions/checkout@v6

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Build release binary
        run: cargo build --release --target ${{ matrix.target }}

      - name: Rename binary
        run: cp target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.asset }}

      - name: Upload binary
        uses: actions/upload-artifact@v7
        with:
          name: ${{ matrix.asset }}
          path: ${{ matrix.asset }}
          if-no-files-found: error

  release:
    name: Create Release
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v6

      - name: Download all binaries
        uses: actions/download-artifact@v8
        with:
          path: artifacts
          merge-multiple: true

      - name: Create GitHub release
        uses: softprops/action-gh-release@v3
        with:
          files: artifacts/*
          generate_release_notes: true