Skip to content

add GitHub Actions workflow to sync formula to homebrew tap on release #1

add GitHub Actions workflow to sync formula to homebrew tap on release

add GitHub Actions workflow to sync formula to homebrew tap on release #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-latest
archive: aipm-x86_64-apple-darwin.tar.gz
- target: aarch64-apple-darwin
runner: macos-latest
archive: aipm-aarch64-apple-darwin.tar.gz
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
archive: aipm-x86_64-unknown-linux-gnu.tar.gz
- target: aarch64-unknown-linux-gnu
runner: ubuntu-latest
archive: aipm-aarch64-unknown-linux-gnu.tar.gz
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/aipm dist/
cd dist
tar czf ../${{ matrix.archive }} aipm
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: ${{ matrix.archive }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: artifacts/*.tar.gz