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 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 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 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
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c 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 with:
files: |
artifacts/prismtty.rb
artifacts/*.tar.gz
artifacts/*.tar.gz.sha256