use targetplatform varible #16
Workflow file for this run
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: Create Release | |
on: | |
push: | |
tags: | |
- "test-*.*.*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Tag Name | |
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/test-}" >> $GITHUB_ENV | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
swag init | |
env GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o build/linux/amd64/logicng-service main.go | |
env GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o build/linux/arm64/logicng-service main.go | |
- name: Build and Push Images | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/booleworks/logicng-service-test:${{ ENV.TAG_NAME }} | |
platforms: linux/arm64,linux/amd64 |