Skip to content

Commit ee45d29

Browse files
authored
Merge pull request #23 from digitalsparky/main
Implement automated workflow for goreleaser builds
2 parents f856dde + 25d929f commit ee45d29

File tree

3 files changed

+87
-29
lines changed

3 files changed

+87
-29
lines changed

.github/workflows/release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
# packages: write
13+
# issues: write
14+
15+
jobs:
16+
goreleaser:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: stable
27+
# More assembly might be required: Docker logins, GPG, etc.
28+
# It all depends on your needs.
29+
- name: Run GoReleaser
30+
uses: goreleaser/goreleaser-action@v5
31+
with:
32+
# either 'goreleaser' (default) or 'goreleaser-pro'
33+
distribution: goreleaser
34+
# 'latest', 'nightly', or a semver
35+
version: latest
36+
args: release --clean
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
40+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 1
5+
6+
before:
7+
hooks:
8+
- go mod tidy
9+
10+
builds:
11+
-
12+
id: "quickpassthrough"
13+
main: ./cmd/main.go
14+
binary: "quickpassthrough"
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- linux
19+
20+
goarch:
21+
- amd64
22+
mod_timestamp: "{{ .CommitTimestamp }}"
23+
24+
archives:
25+
- format: tar.gz
26+
# this name template makes the OS and Arch compatible with the results of `uname`.
27+
name_template: >-
28+
{{ .ProjectName }}_
29+
{{- title .Os }}_
30+
{{- if eq .Arch "amd64" }}x86_64
31+
{{- else if eq .Arch "386" }}i386
32+
{{- else }}{{ .Arch }}{{ end }}
33+
{{- if .Arm }}v{{ .Arm }}{{ end }}
34+
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- "^docs:"
40+
- "^test:"
41+
42+
upx:
43+
-
44+
enabled: true
45+
compress: best
46+
lzma: true
47+
brute: true

cmd/.goreleaser.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)