mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
simplify junk
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v00.*"
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
name: Release CLI
|
||||
name: Build CLI
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,61 +19,44 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
architecture: [x86_64, aarch64]
|
||||
include:
|
||||
# Build on Ubuntu only for x86_64
|
||||
- os: ubuntu-latest
|
||||
architecture: x86_64
|
||||
suffix: unknown-linux-gnu
|
||||
# Cross-compile on macOS for aarch64
|
||||
- os: macos-latest
|
||||
architecture: x86_64
|
||||
suffix: apple-darwin
|
||||
- os: macos-latest
|
||||
architecture: aarch64
|
||||
suffix: unknown-linux-gnu
|
||||
suffix: apple-darwin
|
||||
steps:
|
||||
# Step 1: Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Step 2: Set up Rust toolchain
|
||||
- name: Set up Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
target: ${{ matrix.architecture }}-${{ matrix.suffix }}
|
||||
|
||||
# Install dependencies and set up for macOS cross-compilation
|
||||
- name: Install dependencies (macOS only)
|
||||
# Step 3: Install dependencies (macOS ARM only)
|
||||
- name: Install dependencies for macOS ARM
|
||||
if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64'
|
||||
run: |
|
||||
brew install llvm
|
||||
rustup target add aarch64-unknown-linux-gnu
|
||||
rustup target add aarch64-apple-darwin
|
||||
echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV
|
||||
|
||||
# Step 4: Build the project
|
||||
- name: Build
|
||||
run: |
|
||||
export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }}
|
||||
if [ "${{ matrix.os }}" == "macos-latest" ] && [ "${{ matrix.architecture }}" == "aarch64" ]; then
|
||||
CC=aarch64-linux-gnu-gcc \
|
||||
CXX=aarch64-linux-gnu-g++ \
|
||||
cargo build --release --target $TARGET
|
||||
else
|
||||
cargo build --release --target $TARGET
|
||||
fi
|
||||
cargo build --release --target $TARGET
|
||||
cd target/${TARGET}/release
|
||||
tar -cjf goose-${TARGET}.tar.bz2 goose goosed
|
||||
echo "goose-${TARGET}.tar.bz2" >> $GITHUB_ENV
|
||||
|
||||
# Step 5: Upload the artifacts
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: goose-${{ matrix.architecture }}-${{ matrix.suffix }}
|
||||
path: target/${{ matrix.architecture }}-${{ matrix.suffix }}/release/goose-*.tar.bz2
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
merge-multiple: true
|
||||
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "goose-*.bz2"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user