-
Notifications
You must be signed in to change notification settings - Fork 146
55 lines (44 loc) · 1.06 KB
/
release.yaml
File metadata and controls
55 lines (44 loc) · 1.06 KB
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
47
48
49
50
51
52
53
54
55
# This workflow will build and release golang project
name: Binary release
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.5
with:
fetch-depth: 0 # disable shallow clone - get all
- name: Set up Go 1.x
uses: actions/setup-go@v5.0.1
with:
go-version: stable
id: go
- name: Fetch build tag
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: /bin/bash -e {0}
- name: Print build tag
run: echo "Building release ${VERSION}"
- name: Generate code
run: make generate
- name: Check for changes
run: |
git diff
git diff-index --quiet HEAD
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}