Add v0.0.2 release notes (#63) #39
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: Build Docker image | |
on: | |
push: | |
tags: | |
- v*.*.* | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build Docker image | |
runs-on: ubuntu-24.04 | |
permissions: | |
packages: read | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check if corresponding release note presents | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
FILE="docs/notes/release-${{ github.ref_name }}.md" | |
if [ ! -f "$FILE" ]; then | |
echo "Error: Release note does not exist." | |
exit 1 | |
fi | |
- name: Import GPG key | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: crazy-max/ghaction-import-gpg@v6.2.0 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Initialize Golang environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.4 | |
- name: Install cosign | |
uses: sigstore/cosign-installer@v3.7.0 | |
- name: Initialize QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Initialize Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Pre-download requirements | |
run: go mod download | |
- name: Build binary with tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
VERSION=${{ github.ref_name }} ./build.sh | |
- name: Build tarball for each platform | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
VERSION=${{ github.ref_name }} ./package.sh | |
- name: Build binary without tag | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
PLATFORMS="linux/amd64,linux/arm64,linux/riscv64" ./build.sh | |
- name: Login to Docker registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Build and push Ubuntu experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
id: build-ubuntu-exp | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/riscv64 | |
tags: masteryyh/micro-ddns:experimental,masteryyh/micro-ddns:experimental-oracular | |
- name: Sign Ubuntu experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-ubuntu-exp.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Build and push Alpine experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
id: build-alpine-exp | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/riscv64 | |
file: Dockerfile.alpine | |
tags: masteryyh/micro-ddns:experimental-alpine3.21 | |
- name: Sign Alpine experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-alpine-exp.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Build and push slim experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
id: build-slim-exp | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: Dockerfile.slim | |
tags: masteryyh/micro-ddns:experimental-slim | |
- name: Sign slim experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-slim-exp.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Build and push Ubuntu image | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: build-ubuntu | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/riscv64 | |
tags: masteryyh/micro-ddns:oracular,masteryyh/micro-ddns:${{ github.ref_name }}-oracular,masteryyh/micro-ddns:latest | |
- name: Sign Ubuntu image | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-ubuntu.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Build and push Alpine image | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: build-alpine | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/riscv64 | |
file: Dockerfile.alpine | |
tags: masteryyh/micro-ddns:alpine3.21,masteryyh/micro-ddns:${{ github.ref_name }}-alpine3.21,masteryyh/micro-ddns:alpine | |
- name: Sign Alpine image | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-alpine.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Build and push slim image | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: build-slim | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: Dockerfile.slim | |
tags: masteryyh/micro-ddns:slim,masteryyh/micro-ddns:${{ github.ref_name }}-slim | |
- name: Sign slim image | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cosign sign -y masteryyh/micro-ddns@${{ steps.build-slim.outputs.digest }} | |
env: | |
COSIGN_EXPERIMENTAL: "true" | |
- name: Publish a release using new tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
gh release create ${{ github.ref_name }} \ | |
-F docs/notes/release-${{ github.ref_name }}.md \ | |
output/* | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |