-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (85 loc) · 2.2 KB
/
release.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# yaml-language-server: https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: goreleaser
on:
create:
tags:
- "**"
permissions:
contents: write
packages: write
# issues: write
jobs:
test-mac:
runs-on: macos-latest
steps:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
architecture: x64
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: go build ./...
- name: Test
run: go test ./... -v
test-win:
runs-on: windows-latest
steps:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
architecture: x64
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: go build ./...
- name: Test
run: go test ./... -v
test-linux:
runs-on: ubuntu-latest
steps:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
architecture: x64
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: go build ./...
- name: Test
run: go test ./... -v
goreleaser:
needs:
- test-linux
- test-mac
- test-win
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}