-
Notifications
You must be signed in to change notification settings - Fork 13
37 lines (35 loc) · 1011 Bytes
/
release.yaml
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
name: goreleaser
on:
push:
branches:
- 'test-goreleaser/**'
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
- name: Generate version
run: echo "VERSION=$(git describe --always --tags --dirty)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: (dry-run) GoReleaser
if: startsWith(github.ref_name, 'test-goreleaser')
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --skip=validate,publish
- name: Run GoReleaser
if: startsWith(github.ref_name, 'test-goreleaser') != true
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}