Go/.gitea/workflows/release.yaml
Bo-Yi Wu 79e439dbc7
ci: update goreleaser action and version specification
- Update `goreleaser` action from v5 to v6
- Change `goreleaser` version specification to `~> v2`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-06-11 11:20:41 +08:00

52 lines
1.2 KiB
YAML

name: release-main
on:
push:
tags:
- "*"
env:
GOPATH: /go_path
GOCACHE: /go_cache
jobs:
release-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
go.mod
go.sum
- name: cache go
id: cache-go
uses: actions/cache@v4
with:
path: |
/go_path
/go_cache
key: go_path-${{ steps.hash-go.outputs.hash }
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_FORCE_TOKEN: "gitea"