mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
96 lines
2.8 KiB
YAML
96 lines
2.8 KiB
YAML
on:
|
|
push:
|
|
tags:
|
|
- "v1.*"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
|
|
name: Release CLI
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.os }}-${{ matrix.architecture }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false # Allow independent failures
|
|
matrix:
|
|
include:
|
|
# Linux x86_64 build on Ubuntu
|
|
- os: ubuntu-latest
|
|
architecture: x86_64
|
|
suffix: unknown-linux-gnu
|
|
# macOS x86_64 build
|
|
- os: macos-latest
|
|
architecture: x86_64
|
|
suffix: apple-darwin
|
|
# macOS ARM64 build
|
|
- os: macos-latest
|
|
architecture: aarch64
|
|
suffix: apple-darwin
|
|
|
|
steps:
|
|
# Step 1: Checkout the code
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# Step 2: Set up Rust toolchain
|
|
- name: Set up Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
target: ${{ matrix.architecture }}-${{ matrix.suffix }}
|
|
|
|
# Step 3: Install dependencies for macOS ARM64 builds
|
|
- name: Install dependencies for macOS ARM64
|
|
if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64'
|
|
run: |
|
|
brew install llvm
|
|
rustup target add aarch64-apple-darwin
|
|
echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV
|
|
|
|
- name: Install Libs for Ubuntu linux
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt update -y
|
|
sudo apt install -y libdbus-1-dev libssl-dev gnome-keyring libxcb1-dev
|
|
gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar'
|
|
|
|
|
|
# Step 4: Build the project
|
|
- name: Build
|
|
run: |
|
|
export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }}
|
|
cargo build --release --target $TARGET
|
|
cd target/${TARGET}/release
|
|
tar -cjf goose-${TARGET}.tar.bz2 goose goosed
|
|
echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV
|
|
|
|
# Step 5: Upload artifacts
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: goose-${{ matrix.architecture }}-${{ matrix.suffix }}
|
|
path: ${{ env.ARTIFACT }}
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
# Step 1: Download all build artifacts
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
merge-multiple: true
|
|
|
|
# Step 2: Publish release with artifacts
|
|
- name: Create GitHub release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "goose-*.tar.bz2"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|