prismtty 0.2.3

Fast terminal output highlighter focused on network devices and Unix systems
Documentation
name: release

on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

permissions:
  contents: read

jobs:
  package:
    name: package ${{ matrix.target_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: macos-14
            target_name: darwin-aarch64
          - os: macos-15-intel
            target_name: darwin-x86_64
          - os: ubuntu-24.04
            target_name: linux-x86_64

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
        with:
          toolchain: stable

      - name: Install PCRE2
        run: |
          if [[ "${{ runner.os }}" == "macOS" ]]; then
            brew install pcre2 pkg-config
          else
            sudo apt-get update
            sudo apt-get install -y libpcre2-dev pkg-config
          fi

      - name: Test
        run: cargo test

      - name: Package
        run: bash scripts/package-release.sh "${{ matrix.target_name }}"

      - name: Upload artifact
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: prismtty-${{ matrix.target_name }}
          path: |
            dist/*.tar.gz
            dist/*.tar.gz.sha256

  github-release:
    name: publish GitHub release
    runs-on: ubuntu-24.04
    needs: package
    if: startsWith(github.ref, 'refs/tags/')
    permissions:
      contents: write
      id-token: write

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
        with:
          toolchain: stable

      - name: Authenticate with crates.io
        id: crates-io-auth
        uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4

      - name: Publish crate
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}
        run: cargo publish --locked

      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          path: artifacts
          merge-multiple: true

      - name: Generate Homebrew formula
        run: bash scripts/generate-homebrew-formula.sh artifacts/prismtty.rb artifacts

      - name: Publish release
        uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
        with:
          files: |
            artifacts/prismtty.rb
            artifacts/*.tar.gz
            artifacts/*.tar.gz.sha256