Skip to content

Commit 7dea50a

Browse files
authored
Merge pull request #173 from JoelSpeed/goreleaser-config
Add configuration for goreleaser
2 parents a9a8d5c + f9a03ff commit 7dea50a

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: goreleaser
2+
3+
on:
4+
pull_request:
5+
push:
6+
# run only against tags
7+
tags:
8+
- "*"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: stable
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
# either 'goreleaser' (default) or 'goreleaser-pro'
29+
distribution: goreleaser
30+
# 'latest', 'nightly', or a semver
31+
version: "~> v2"
32+
args: release --clean
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ testbin/*
2222

2323
# Do not check in vendor if it's set up locally
2424
vendor/
25+
# Added by goreleaser init:
26+
dist/

.goreleaser.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 2
2+
3+
# before:
4+
# hooks:
5+
# You may remove this if you don't use go modules.
6+
# - go mod tidy
7+
8+
builds:
9+
- env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- windows
14+
- darwin
15+
main: ./cmd/golangci-lint-kube-api-linter/
16+
17+
archives:
18+
- formats: [tar.gz]
19+
# this name template makes the OS and Arch compatible with the results of `uname`.
20+
name_template: >-
21+
{{ .ProjectName }}_
22+
{{- title .Os }}_
23+
{{- if eq .Arch "amd64" }}x86_64
24+
{{- else if eq .Arch "386" }}i386
25+
{{- else }}{{ .Arch }}{{ end }}
26+
{{- if .Arm }}v{{ .Arm }}{{ end }}
27+
# use zip for windows archives
28+
format_overrides:
29+
- goos: windows
30+
formats: [zip]
31+
32+
changelog:
33+
sort: asc
34+
filters:
35+
exclude:
36+
- "^docs:"
37+
- "^test:"
38+
39+
release:
40+
footer: >-
41+
42+
---
43+
44+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

0 commit comments

Comments
 (0)