feat: add arm platform support #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: semantic-release | |
id: semantic | |
uses: ./ | |
with: | |
branches: | | |
[ | |
'+([0-9])?(.{+([0-9]),x}).x', | |
'main', | |
'next', | |
'next-major', | |
{ | |
name: 'beta', | |
prerelease: true | |
}, | |
{ | |
name: 'alpha', | |
prerelease: true | |
} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Dump semantic outputs | |
if: steps.semantic.outputs.new-release-published == 'true' | |
run: | | |
echo "Outputs:\n" | |
echo "$SEMANTIC_OUTPUTS" | |
echo "\n-----\n\nEnvironment Variables:\n" | |
echo "NEW_RELEASE_PUBLISHED: $NEW_RELEASE_PUBLISHED" | |
echo "RELEASE_VERSION: $RELEASE_VERSION" | |
echo "RELEASE_MAJOR: $RELEASE_MAJOR" | |
echo "RELEASE_MINOR: $RELEASE_MINOR" | |
echo "RELEASE_PATCH: $RELEASE_PATCH" | |
echo "RELEASE_NOTES: $RELEASE_NOTES" | |
echo "RELEASE_TYPE: $RELEASE_TYPE" | |
echo "RELEASE_CHANNEL: $RELEASE_CHANNEL" | |
echo "RELEASE_GIT_HEAD: $RELEASE_GIT_HEAD" | |
echo "RELEASE_GIT_TAG: $RELEASE_GIT_TAG" | |
echo "RELEASE_NAME: $RELEASE_NAME" | |
env: | |
SEMANTIC_OUTPUTS: ${{ toJson(steps.semantic-dry-run.outputs) }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: docker login | |
run: | | |
echo "$GCR_TOKEN" | docker login ghcr.io -u codfish --password-stdin | |
env: | |
GCR_TOKEN: ${{ secrets.GCR_TOKEN }} | |
# Dockerhub is auto synced with the repo, no need to explicitly deploy | |
- name: build and push latest docker image to GCR | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/arm64,linux/amd64 | |
push: true | |
tags: ghcr.io/codfish/semantic-release-action:latest | |
- name: push docker images for releases to GCR | |
if: steps.semantic.outputs.new-release-published == 'true' | |
run: | | |
docker tag ghcr.io/codfish/semantic-release-action ghcr.io/codfish/semantic-release-action:$VERSION_TAG | |
docker tag ghcr.io/codfish/semantic-release-action ghcr.io/codfish/semantic-release-action:$MAJOR_TAG | |
docker push ghcr.io/codfish/semantic-release-action:$VERSION_TAG | |
docker push ghcr.io/codfish/semantic-release-action:$MAJOR_TAG | |
env: | |
VERSION_TAG: v${{ steps.semantic.outputs.release-version }} | |
MAJOR_TAG: v${{ steps.semantic.outputs.release-major }} |