-
-
Notifications
You must be signed in to change notification settings - Fork 28
61 lines (50 loc) · 1.26 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: 'goreleaser'
on:
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
push:
branches:
- main
- release/v*
paths-ignore:
- '.github/**'
- 'docs/**'
- 'examples/**'
- 'test/**'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions: {}
jobs:
build:
name: 'Build Binaries'
runs-on: ubuntu-latest
steps:
# Checkout the repo
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
# Setup Go
- name: 'Setup Go'
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Print Go version
- run: go version
# Trial build
- name: Test build
if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref_name != 'main')
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --config ./.goreleaser.yml --clean --snapshot
release:
if: github.event_name == 'push'
needs: build
uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
with:
publish: true
secrets: inherit