From 3acc126bd4b7a659eb7da24ccefbc9f6cc85199a Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:47:47 +1100 Subject: [PATCH] simplify junk --- .github/workflows/cli-release.yml | 45 ++++++++++--------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 66429a3d1c..ee8fad103a 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -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 }}