Skip to content

Commit

Permalink
use go-releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
jandelgado committed Oct 11, 2024
1 parent 18edd84 commit ae94834
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 39 deletions.
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: cmd/gcov2lcov
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:'

0 comments on commit ae94834

Please sign in to comment.