2023-05-11 08:56:11 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v[0-9]+.[0-9]+.[0-9]+
|
|
|
|
- v[0-9]+.[0-9]+.[0-9]+-*
|
|
|
|
|
2023-10-14 01:54:50 +08:00
|
|
|
name: "Release: Make release candidate"
|
2023-05-11 08:56:11 +08:00
|
|
|
jobs:
|
|
|
|
draft_release:
|
|
|
|
name: draft release
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-02 22:26:20 +08:00
|
|
|
permissions:
|
|
|
|
packages: write
|
2023-06-06 18:52:09 +08:00
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
2023-05-11 08:56:11 +08:00
|
|
|
steps:
|
|
|
|
|
2023-08-22 01:00:56 +08:00
|
|
|
- name: Set up QEMU
|
2023-09-20 22:57:44 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-08-22 01:00:56 +08:00
|
|
|
|
2023-05-11 08:56:11 +08:00
|
|
|
- name: Checkout repo
|
2023-09-08 02:10:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-05-11 08:56:11 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-08-22 01:00:56 +08:00
|
|
|
# Why "fetch-depth: 0"? To generate the release notes, we need the
|
|
|
|
# full git history. A shallow checkout would make release notes going
|
|
|
|
# back one commit.
|
2023-05-11 08:56:11 +08:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2023-09-20 23:32:58 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-05-11 08:56:11 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
|
|
|
|
2023-06-02 22:26:20 +08:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-09-20 23:32:58 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-06-02 22:26:20 +08:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-05-11 08:56:11 +08:00
|
|
|
- name: Set up Go
|
2023-12-12 04:23:00 +08:00
|
|
|
uses: actions/setup-go@v5
|
2023-05-11 08:56:11 +08:00
|
|
|
with:
|
2023-10-08 23:52:39 +08:00
|
|
|
go-version: ^1.21
|
2023-05-11 08:56:11 +08:00
|
|
|
|
2023-12-14 03:15:35 +08:00
|
|
|
# Stringer is needed because .goreleaser includes "go generate ./..."
|
|
|
|
- name: Install stringer
|
|
|
|
run: |
|
|
|
|
go install golang.org/x/tools/cmd/stringer@latest
|
|
|
|
|
2023-08-22 01:00:56 +08:00
|
|
|
-
|
|
|
|
id: release
|
|
|
|
name: Goreleaser release
|
2023-09-20 23:34:59 +08:00
|
|
|
uses: goreleaser/goreleaser-action@v5
|
2023-08-22 01:00:56 +08:00
|
|
|
with:
|
|
|
|
distribution: goreleaser
|
|
|
|
version: latest
|
|
|
|
args: release
|
2023-05-11 08:56:11 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|