-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (43 loc) · 1.34 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: publish
on:
push:
tags:
- '*'
jobs:
# Publish project package(s)
publish:
name: publish package
runs-on: ubuntu-latest
timeout-minutes: 20
if: startsWith(github.ref, 'refs/tags/')
steps:
# Checkout code
- name: Checkout repository
uses: actions/checkout@v4
# This is required for the changelog to be properly generated
with:
fetch-depth: 0
# Prepare runner environment
- name: Set up runner environment
run: ./.github/workflows/assets/utils.sh setup
env:
GITHUB_USER: ${{ github.actor }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
# Use goreleaser to create the new release
# https://github.com/goreleaser/goreleaser-action
- name: Create release
uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --skip=validate
env:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Login of the user that initiated the workflow run
GITHUB_USER: ${{ github.actor }}