Skip to content

actions: fix the docker tag #9

actions: fix the docker tag

actions: fix the docker tag #9

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
env:
GO_VERSION: "stable"
CGO_ENABLED: "0"
APP: "stunmesh"
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
os: [linux, darwin]
arch: [amd64, arm64, arm, mipsle]
exclude:
- os: darwin
arch: mipsle
- os: darwin
arch: arm
steps:
- uses: actions/checkout@v4
- name: tag
id: tag
run: echo "TAG=$(git describe --tags --dirty)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: go build -v -o ${{ env.APP}}-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.tag.outputs.TAG }} .
env:
CGO_ENABLED: 0
GOARCH: ${{ matrix.arch }}
GOOS: ${{ matrix.os }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.APP }}-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.tag.outputs.TAG }}
docker:
name: Build Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ github.repository_owner }}/${{ env.APP }}
- uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: ${{ steps.meta.outputs.tags }}, ${{ github.repository_owner }}/${{ env.APP }}:latest
labels: ${{ steps.meta.outputs.labels }}