Change TAG to VERSION in build script #17
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: Release a new version | |
on: | |
push: | |
tags: | |
- v*.*.* | |
env: | |
DOCKER_HUB_IMAGE: mm62/tmpbbs | |
jobs: | |
create-release: | |
name: Build and publish a container image and create a GitHub release | |
runs-on: ubuntu-latest | |
permissions: | |
attestations: write | |
contents: write | |
id-token: write | |
packages: write | |
steps: | |
- name: Log in to Docker Hub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Extract image metadata | |
id: metadata | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 | |
with: | |
images: | | |
${{ env.DOCKER_HUB_IMAGE }} | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=semver,pattern={{raw}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf | |
- name: Set up buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 | |
- name: Build and push image | |
id: push | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm,linux/arm64 | |
build-args: | | |
VERSION=${{ steps.metadata.outputs.version }} | |
COMMIT=${{ github.sha }} | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
push: true | |
- name: Generate signed build provenance attestation for Docker Hub | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-name: index.docker.io/${{ env.DOCKER_HUB_IMAGE }} | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true | |
- name: Generate signed build provenance attestation for GitHub Container Registry | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-name: ghcr.io/${{ github.repository }} | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
- name: Build binaries | |
run: ./build-release-binaries.sh "${{ steps.metadata.outputs.version }}" "${{ github.sha }}" | |
- name: Create release | |
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 | |
with: | |
body: | | |
### Container Images | |
- ${{ env.DOCKER_HUB_IMAGE }}:${{ steps.metadata.outputs.version }} | |
- ghcr.io/${{ github.repository }}:${{ steps.metadata.outputs.version }} | |
files: release/* | |
generate_release_notes: true |