From 5d7d7057eebcb662d70d8d4b4e7442dda9114cb4 Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sun, 25 Aug 2024 11:28:53 +0900 Subject: [PATCH] Update workflow files for CI --- .github/workflows/go.yml | 27 +++++++++++++++++++++------ .github/workflows/release.yml | 2 +- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 77ea7ec..0f5cfd9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: build +name: Build on: [ push, pull_request ] @@ -40,12 +40,27 @@ jobs: run: echo "GOSS_USE_ALPHA=1" >> "$GITHUB_ENV" - if: runner.os == 'macOS' + name: Setup docker run: | - curl -L "https://github.com/goss-org/goss/archive/${{ env.goss_commit_hash }}.tar.gz" -o goss.tar.gz - tar xzvf goss.tar.gz - cd "goss-${{ env.goss_commit_hash }}" - make build - cd .. + brew install docker colima + colima start + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN_202506 }} + + - if: runner.os == 'macOS' + name: Pull from GitHub Container Registry + run: | + docker pull --platform=linux/amd64 ghcr.io/matsuo/goss:latest + docker run --platform=linux/amd64 --rm -i -v /$(pwd):/tmp ghcr.io/matsuo/goss:latest bash <<'EOF' + cd /root/go/src/github.com/goss-org/goss + cp ./release/goss-darwin-amd64 /tmp/goss-darwin-amd64 + cp ./release/goss-darwin-arm64 /tmp/goss-darwin-arm64 + EOF - if: runner.os == 'Windows' shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60ee729..d753abf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: Release on: push: