Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use goreleaser #23

Merged
merged 4 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: daily
commit-message:
prefix: "[gomod] "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
commit-message:
prefix: "[gh-actions] "

25 changes: 25 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
tags:
- 'v*'

name: Upload release assets after tagging
jobs:
build:
name: create assets
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.1
- name: Checkout code
uses: actions/checkout@v4
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53 changes: 14 additions & 39 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.23.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.52.2
- name: Run linters
run: |
export PATH=$PATH:$(go env GOPATH)/bin
./pre-commit
version: latest

test:
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
goversion: ["1.20", "1.21", "1.22", "1.23"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- name: Run tests
Expand All @@ -47,46 +43,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
buildversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
testversion: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
buildversion: ["1.20", "1.21", "1.22", "1.23"]
testversion: ["1.20", "1.21", "1.22", "1.23"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go to build artifact
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.buildversion }}
- name: Build artifact for inttest
run: |
go version
GO111MODULE=on make build-linux
make build-linux
- name: Install Go for inttest
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.testversion }}
- name: Integration test
run: |
go version
make inttest

build:
runs-on: ubuntu-latest
needs: [lint, test, inttest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: build
run: |
go version
make build-linux
make build-windows
make build-darwin
- name: upload artifacts
uses: actions/upload-artifact@master
with:
name: bin
path: bin/
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 2
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
dir: .
goos:
- linux
- darwin
- windows
- freebsd
- openbsd
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: arm
- goos: openbsd
goarch: arm64
- goos: windows
goarch: arm
archives:
- files:
- README.md
- LICENSE
- CHANGELOG.md
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# changelog for gcov2lcov

## 1.1.0 [2024-10-11]

* use gorealser for builds and provide additional versions
* dependency upgrades

## 1.0.6 [2023-08-18]

* performance otimizations (thanks to zzh8829, #16)
Expand Down