From 7cdf4e3c4542d69c8edccfb910214224359dc4cb Mon Sep 17 00:00:00 2001 From: archstrap Date: Sat, 31 Jan 2026 08:08:59 +0530 Subject: [PATCH] Add MacOs binary support --- .github/workflows/auto-tag.yml | 47 ++++++++++++++++++++++++++++++---- .github/workflows/ci.yml | 32 ++++++++++++++++++----- 2 files changed, 67 insertions(+), 12 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index d4c4114..6625a24 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -5,10 +5,18 @@ on: branches: [main] jobs: - tag-and-release: - runs-on: ubuntu-latest - permissions: - contents: write + build: + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-latest + artifact_name: gosh-linux-amd64 + - runs-on: macos-latest + artifact_name: gosh-darwin-arm64 + - runs-on: macos-13 + artifact_name: gosh-darwin-amd64 + runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 with: @@ -25,6 +33,25 @@ jobs: - name: Build run: go build -o gosh app/*.go + - name: Rename binary + run: mv gosh ${{ matrix.artifact_name }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact_name }} + path: ${{ matrix.artifact_name }} + + tag-and-release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get latest tag and bump patch id: bump run: | @@ -50,11 +77,21 @@ jobs: git tag ${{ steps.bump.outputs.new_tag }} git push origin ${{ steps.bump.outputs.new_tag }} + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Flatten artifacts for release + run: | + for dir in gosh-*/; do + [ -d "$dir" ] && cp "$dir"* . 2>/dev/null || true + done + ls -la gosh-* + - name: Create Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.bump.outputs.new_tag }} - files: gosh + files: gosh-* generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b00ed5d..fdfc2ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,17 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-latest + artifact_name: gosh-linux-amd64 + - runs-on: macos-latest + artifact_name: gosh-darwin-arm64 + - runs-on: macos-13 # Intel Mac (x64) + artifact_name: gosh-darwin-amd64 + runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 @@ -24,11 +34,14 @@ jobs: - name: Build run: go build -o gosh app/*.go + - name: Rename binary + run: mv gosh ${{ matrix.artifact_name }} + - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: gosh-${{ runner.os }}-${{ runner.arch }} - path: gosh + name: ${{ matrix.artifact_name }} + path: ${{ matrix.artifact_name }} release: needs: build @@ -37,15 +50,20 @@ jobs: permissions: contents: write steps: - - name: Download artifact + - name: Download all artifacts uses: actions/download-artifact@v4 - with: - name: gosh-${{ runner.os }}-${{ runner.arch }} + + - name: Flatten artifacts for release + run: | + for dir in gosh-*/; do + [ -d "$dir" ] && cp "$dir"* . 2>/dev/null || true + done + ls -la gosh-* - name: Create Release uses: softprops/action-gh-release@v2 with: - files: gosh + files: gosh-* generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}