Skip to content

Commit 2d7073a

Browse files
committed
Release v1.5.1, fix GH action, Go modules caching & GoReleaser
1 parent d2688ed commit 2d7073a

2 files changed

Lines changed: 57 additions & 33 deletions

File tree

.github/workflows/go-release-build.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
tags:
88
- 'v*'
99
pull_request:
10+
workflow_dispatch:
1011

1112
jobs:
1213
build:
@@ -21,28 +22,28 @@ jobs:
2122
name: Set up Go
2223
uses: actions/setup-go@v5
2324
with:
24-
go-version: 1.24
25+
go-version: 1.25.0
26+
# Enables automatic caching for Go modules and build artifacts
27+
cache: true
28+
# Optional: Points to the directory containing your go.mod if not in the root
29+
# cache-dependency-path: subdir/go.sum
2530

2631
-
27-
name: Cache Go modules
28-
uses: actions/cache@v4
29-
# Do before go get
30-
with:
31-
path: ~/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
32+
name: Go environment check
33+
run: |
34+
go env GOCACHE
35+
go env GOMODCACHE
3536
3637
-
37-
name: Tests
38+
name: Build & Tests
3839
run: |
3940
go mod tidy
4041
go build -v -trimpath
4142
go test -v ./...
4243
4344
-
4445
name: Run GoReleaser
45-
uses: goreleaser/goreleaser-action@v5
46+
uses: goreleaser/goreleaser-action@v7
4647
if: success() && startsWith(github.ref, 'refs/tags/')
4748
with:
4849
version: latest
@@ -52,12 +53,12 @@ jobs:
5253

5354
-
5455
name: Install Cloudsmith CLI
55-
run: pip install --upgrade cloudsmith-cli
5656
if: success() && startsWith(github.ref, 'refs/tags/')
57-
# Cloudsmith CLI tooling for pushing releases
58-
# See https://help.cloudsmith.io/docs/cli
57+
uses: cloudsmith-io/cloudsmith-cli-action@v2
58+
with:
59+
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
60+
cli-version: 'latest'io/cloudsmith-cli-action@v2
5961

60-
# Publish to cloudsmith repo
6162
-
6263
name: Publish package to cloudsmith
6364
if: success() && startsWith(github.ref, 'refs/tags/')

.goreleaser.yml

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
project_name: cascadia
1+
version: 2
22

3-
archives:
4-
- format: tar.gz
5-
wrap_in_directory: true
6-
format_overrides:
7-
- goos: windows
8-
format: zip
9-
# remove README and LICENSE
10-
files:
11-
- none*
3+
# defaults to the name of the repository
4+
#project_name: cascadia
125

136
builds:
147
- env: [CGO_ENABLED=0]
@@ -19,13 +12,43 @@ builds:
1912
goarch:
2013
- amd64
2114
- arm64
15+
# Strips debug information to keep binaries small
16+
ldflags:
17+
- -s -w
2218

2319
nfpms:
24-
- maintainer: Tong Sun <suntong@cpan.org>
25-
description: CSS selector CLI tool
26-
homepage: https://github.com/suntong/cascadia
27-
license: MIT
28-
formats:
29-
- deb
30-
- rpm
31-
- apk
20+
- #id: xx
21+
# 3. Using variables for the Linux packaging
22+
package_name: "{{ .ProjectName }}"
23+
description: CSS selector CLI tool
24+
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
25+
homepage: https://github.com/suntong/{{ .ProjectName }}
26+
maintainer: Tong Sun <suntong@cpan.org>
27+
license: MIT
28+
formats:
29+
- apk
30+
- deb
31+
- rpm
32+
33+
archives:
34+
- formats:
35+
- tar.gz
36+
# 2. Reverted back to using variables
37+
#name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
38+
format_overrides:
39+
- goos: windows
40+
formats:
41+
- zip
42+
# remove README and LICENSE
43+
files:
44+
- none*
45+
46+
snapshot:
47+
version_template: "{{ incpatch .Version }}-snapshot"
48+
49+
changelog:
50+
sort: asc
51+
filters:
52+
exclude:
53+
- "^docs:"
54+
- "^test:"

0 commit comments

Comments
 (0)