Skip to content

Commit

Permalink
ci: added go releaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
retr0h committed Jun 22, 2024
1 parent 1d6801a commit 830580a
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: release packages
on:
push:
tags:
- "v*"

permissions:
contents: write
# packages: write
# issues: write
# permission is mandatory for trusted publishing
id-token: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
before:
hooks:
- go mod tidy

builds:
- skip: true

archives:
- format: binary
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}.dev"
changelog:
sort: asc
filters:
exclude:
- '^test:'
- "^chore"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: "Features"
regexp: "^.*?feat:.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*?fix:.*$"
order: 1
- title: "Chores"
regexp: "^.*?chore:.*$"
order: 2
- title: "Docs"
regexp: "^.*?docs:.*$"
order: 3
- title: "CI"
regexp: "^.*?ci:.*$"
order: 4
- title: "Build"
regexp: "^.*?build:.*$"
order: 5
- title: Others
order: 999
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ tasks:
# https://github.com/mvdan/gofumpt/issues/114
- test -z "$(gofumpt -d -e . | tee /dev/stderr)"
- test -z "$(golines -l --dry-run --base-formatter=gofumpt -w .)"

build:
desc: Build ARCH compatible binary.
cmds:
- goreleaser release --snapshot --clean
5 changes: 0 additions & 5 deletions docs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ All kinds of contributions are welcome, whether its a typo fix or a shiny new
feature. You can also contribute by upvoting/commenting on issues or helping to
answer questions.

> I'm stuck, where can I get help?
If you have questions, feel free open a [Discussion][] on GitHub.

<!-- prettier-ignore-start -->
[git-url-parse]: https://github.com/retr0h/git-url-parse
[Go]: https://go.dev
Expand All @@ -114,7 +110,6 @@ If you have questions, feel free open a [Discussion][] on GitHub.
[golangci-lint]: https://golangci-lint.run
[Prettier]: https://prettier.io/
[Docusaurus]: https://docusaurus.io
[Discussion]: https://github.com/retr0h/go-gilt/discussions
[Conventional Commits]: https://www.conventionalcommits.org
[Bats]: https://github.com/bats-core/bats-core
<!-- prettier-ignore-end -->

0 comments on commit 830580a

Please sign in to comment.