Skip to content

Commit c7016b9

Browse files
authoredFeb 8, 2023
Auto-release the CLI tools with GoReleaser (#69)
1 parent 9a6a54e commit c7016b9

File tree

5 files changed

+71
-4
lines changed

5 files changed

+71
-4
lines changed
 

‎.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- run: git fetch --force --tags
19+
- uses: actions/setup-go@v3
20+
with:
21+
go-version: '>=1.20.0'
22+
cache: true
23+
- uses: goreleaser/goreleaser-action@v4
24+
with:
25+
distribution: goreleaser
26+
version: latest
27+
args: release --clean
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
30+

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
publications/*
2-
*.old
2+
*.old
3+
dist/

‎.goreleaser.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Make sure to check the documentation at https://goreleaser.com
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- main: ./cmd/rwp/
7+
id: rwp
8+
binary: rwp
9+
goos:
10+
- linux
11+
- windows
12+
- darwin
13+
14+
- main: ./cmd/server/
15+
id: rwp-server
16+
binary: rwp-server
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
22+
archives:
23+
- format: tar.gz
24+
# this name template makes the OS and Arch compatible with the results of uname.
25+
name_template: >-
26+
{{ .ProjectName }}_
27+
{{- title .Os }}_
28+
{{- if eq .Arch "amd64" }}x86_64
29+
{{- else if eq .Arch "386" }}i386
30+
{{- else }}{{ .Arch }}{{ end }}
31+
{{- if .Arm }}v{{ .Arm }}{{ end }}
32+
# use zip for windows archives
33+
format_overrides:
34+
- goos: windows
35+
format: zip
36+
checksum:
37+
name_template: 'checksums.txt'
38+
snapshot:
39+
name_template: "{{ incpatch .Version }}-next"

‎go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ go 1.18
55
require (
66
github.com/agext/regexp v1.3.0
77
github.com/deckarep/golang-set v1.7.1
8-
github.com/google/uuid v1.3.0
98
github.com/gorilla/mux v1.7.4
109
github.com/opds-community/libopds2-go v0.0.0-20170628075933-9c163cf60f6e
1110
github.com/pdfcpu/pdfcpu v0.3.13

‎go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe
142142
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
143143
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
144144
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
145-
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
146-
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
147145
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
148146
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
149147
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=

0 commit comments

Comments
 (0)
Please sign in to comment.