diff options
| author | Hazel Atkinson <19270622+yellowsink@users.noreply.github.com> | 2025-04-11 20:13:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-11 20:13:19 +0100 |
| commit | 7e9762bbb0552ffede19b72035ec9c65ef2d1c68 (patch) | |
| tree | d788660b488ec9c12f31a954f706f338794788cf | |
| parent | b2f31c65e09e054f39eac5f8fe9847d08e203855 (diff) | |
| download | containerspy-7e9762bbb0552ffede19b72035ec9c65ef2d1c68.tar.gz containerspy-7e9762bbb0552ffede19b72035ec9c65ef2d1c68.tar.bz2 containerspy-7e9762bbb0552ffede19b72035ec9c65ef2d1c68.zip | |
more ci tweaks
| -rw-r--r-- | .github/workflows/publish.yml | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 04a8742..50a13a2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,8 @@ jobs: strategy: fail-fast: false matrix: - platform: [linux/amd64, linux/arm64] + runner: [ubuntu-latest, macos-latest] + permissions: packages: write @@ -23,12 +24,19 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 - - name: Setup version number + - name: Setup variables run: | # docker/build-push-action supports comma separated tags DOCKER_IMAGE_TAG_BASE="ghcr.io/${{ github.repository }}" DOCKER_IMAGE_TAGS="$DOCKER_IMAGE_TAG_BASE:dev" + # use ubuntu-latest to build x86 and macos-latest to build aarch64 + if [[ "${{ matrix.runner }}" == macos-latest ]]; then + echo "DOCKER_PLATFORM=linux/arm64" >> $GITHUB_ENV + else + echo "DOCKER_PLATFORM=linux/amd64" >> $GITHUB_ENV + fi + # if this is a versioned release, github.ref will start with 'refs/tags/v' GH_REF="${{ github.ref }}" # cut off 'refs/tags/v' @@ -38,9 +46,13 @@ jobs: fi echo "DOCKER_IMAGE_TAGS=\"$DOCKER_IMAGE_TAGS\"" >> $GITHUB_ENV + # this is dumb + echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Check if version already exists in registry run: | + # this is still dumb + VERSION=${{ env.VERSION }} if docker manifest inspect ghcr.io/${{ github.repository }}:$VERSION > /dev/null 2>&1; then echo "Image with version $VERSION already exists in registry" exit 1 @@ -63,6 +75,6 @@ jobs: file: ./Dockerfile push: true tags: ${{ env.DOCKER_IMAGE_TAGS }} - platforms: ${{ matrix.platform }} + platforms: ${{ env.DOCKER_PLATFORM }} cache-from: type=gha - cache-to: type=gha,mode=max
\ No newline at end of file + cache-to: type=gha,mode=max |
