2021-03-19 14:05:44 +08:00
|
|
|
name: goreleaser
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*" # Will trigger only if tag is pushed matching pattern `v*` (Eg: `v0.1.0`)
|
|
|
|
|
2023-08-11 02:32:43 +08:00
|
|
|
permissions: write-all
|
2023-08-09 16:39:56 +08:00
|
|
|
|
2021-03-19 14:05:44 +08:00
|
|
|
jobs:
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-08-09 16:39:56 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-03-19 14:05:44 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-08-09 17:20:51 +08:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
2021-03-19 14:05:44 +08:00
|
|
|
- name: Set up Go
|
2023-08-09 16:39:56 +08:00
|
|
|
uses: actions/setup-go@v4
|
2021-03-19 14:05:44 +08:00
|
|
|
with:
|
2023-08-09 16:39:56 +08:00
|
|
|
go-version: "1.20"
|
2021-03-19 14:05:44 +08:00
|
|
|
|
|
|
|
- name: Login to Docker Registry
|
2023-07-18 13:46:25 +08:00
|
|
|
uses: docker/login-action@v2
|
2021-03-19 14:05:44 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-04-12 00:12:41 +08:00
|
|
|
- name: Login to GitHub Docker Registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-03-19 14:05:44 +08:00
|
|
|
- name: Prepare Dependencies
|
|
|
|
run: |
|
2021-09-28 01:56:56 +08:00
|
|
|
make dist
|
2021-03-19 14:05:44 +08:00
|
|
|
|
2023-09-08 00:53:17 +08:00
|
|
|
- name: Check Docker Version
|
|
|
|
run: |
|
|
|
|
docker version
|
|
|
|
|
2021-03-19 14:05:44 +08:00
|
|
|
- name: Run GoReleaser
|
2023-07-18 13:46:25 +08:00
|
|
|
uses: goreleaser/goreleaser-action@v4
|
2021-03-19 14:05:44 +08:00
|
|
|
with:
|
|
|
|
version: latest
|
2023-07-18 13:46:25 +08:00
|
|
|
args: release --parallelism 1 --clean --skip-validate
|
2021-03-19 14:05:44 +08:00
|
|
|
env:
|
2021-03-19 18:26:34 +08:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|