Add v0.0.1 release notes (#57) #32
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 | |
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: Initialize Golang environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.4 | |
- 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') }} | |
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: Build and push Alpine experimental image | |
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} | |
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: Build and push Ubuntu image | |
if: startsWith(github.ref, 'refs/tags/v') | |
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: Build and push Alpine image | |
if: startsWith(github.ref, 'refs/tags/v') | |
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: 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 }} |