Skip to content

Commit 4efa331

Browse files
authored
Use goreleaser (#23)
1 parent 47fef9e commit 4efa331

File tree

5 files changed

+105
-39
lines changed

5 files changed

+105
-39
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
commit-message:
8+
prefix: "[gomod] "
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: daily
13+
commit-message:
14+
prefix: "[gh-actions] "
15+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
name: Upload release assets after tagging
7+
jobs:
8+
build:
9+
name: create assets
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Install Go
13+
uses: actions/setup-go@v5
14+
with:
15+
go-version: 1.23.1
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Run GoReleaser
19+
uses: goreleaser/goreleaser-action@v6
20+
if: startsWith(github.ref, 'refs/tags/')
21+
with:
22+
version: latest
23+
args: release --clean
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test_and_build.yml

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,26 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
- name: Install Go
17-
uses: actions/setup-go@v4
17+
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.21.x
19+
go-version: 1.23.x
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v3
21+
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.52.2
24-
- name: Run linters
25-
run: |
26-
export PATH=$PATH:$(go env GOPATH)/bin
27-
./pre-commit
23+
version: latest
2824

2925
test:
3026
runs-on: ubuntu-latest
3127
strategy:
3228
matrix:
33-
goversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
29+
goversion: ["1.20", "1.21", "1.22", "1.23"]
3430
steps:
3531
- name: Checkout code
36-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3733
- name: Install Go
38-
uses: actions/setup-go@v4
34+
uses: actions/setup-go@v5
3935
with:
4036
go-version: ${{ matrix.goversion }}
4137
- name: Run tests
@@ -47,46 +43,25 @@ jobs:
4743
runs-on: ubuntu-latest
4844
strategy:
4945
matrix:
50-
buildversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
51-
testversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
46+
buildversion: ["1.20", "1.21", "1.22", "1.23"]
47+
testversion: ["1.20", "1.21", "1.22", "1.23"]
5248
steps:
5349
- name: Checkout code
54-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5551
- name: Install Go to build artifact
56-
uses: actions/setup-go@v4
52+
uses: actions/setup-go@v5
5753
with:
5854
go-version: ${{ matrix.buildversion }}
5955
- name: Build artifact for inttest
6056
run: |
6157
go version
62-
GO111MODULE=on make build-linux
58+
make build-linux
6359
- name: Install Go for inttest
64-
uses: actions/setup-go@v4
60+
uses: actions/setup-go@v5
6561
with:
6662
go-version: ${{ matrix.testversion }}
6763
- name: Integration test
6864
run: |
6965
go version
7066
make inttest
7167
72-
build:
73-
runs-on: ubuntu-latest
74-
needs: [lint, test, inttest]
75-
steps:
76-
- name: Checkout code
77-
uses: actions/checkout@v3
78-
- name: Install Go
79-
uses: actions/setup-go@v4
80-
with:
81-
go-version: 1.21.x
82-
- name: build
83-
run: |
84-
go version
85-
make build-linux
86-
make build-windows
87-
make build-darwin
88-
- name: upload artifacts
89-
uses: actions/upload-artifact@master
90-
with:
91-
name: bin
92-
path: bin/

.goreleaser.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: 2
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
dir: .
9+
goos:
10+
- linux
11+
- darwin
12+
- windows
13+
- freebsd
14+
- openbsd
15+
goarch:
16+
- amd64
17+
- arm
18+
- arm64
19+
goarm:
20+
- 6
21+
- 7
22+
ignore:
23+
- goos: darwin
24+
goarch: arm
25+
- goos: openbsd
26+
goarch: arm64
27+
- goos: windows
28+
goarch: arm
29+
archives:
30+
- files:
31+
- README.md
32+
- LICENSE
33+
- CHANGELOG.md
34+
format_overrides:
35+
- goos: windows
36+
format: zip
37+
checksum:
38+
name_template: 'checksums.txt'
39+
snapshot:
40+
version_template: "{{ incpatch .Version }}-next"
41+
changelog:
42+
sort: asc
43+
filters:
44+
exclude:
45+
- '^docs:'
46+
- '^test:'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# changelog for gcov2lcov
22

3+
## 1.1.0 [2024-10-11]
4+
5+
* use gorealser for builds and provide additional versions
6+
* dependency upgrades
7+
38
## 1.0.6 [2023-08-18]
49

510
* performance otimizations (thanks to zzh8829, #16)

0 commit comments

Comments
 (0)