From 830580aee38003b0fd6787871bf50439e88e1bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Fri, 21 Jun 2024 17:54:42 -0700 Subject: [PATCH] ci: added go releaser workflow --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++ .goreleaser.yml | 46 +++++++++++++++++++++++++++++++++++ Taskfile.yml | 5 ++++ docs/docs/contributing.md | 5 ---- 4 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3b5adea --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..a77f88a --- /dev/null +++ b/.goreleaser.yml @@ -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 diff --git a/Taskfile.yml b/Taskfile.yml index 11e9c7e..54f3610 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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 diff --git a/docs/docs/contributing.md b/docs/docs/contributing.md index ff26d77..e7cdd6b 100644 --- a/docs/docs/contributing.md +++ b/docs/docs/contributing.md @@ -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. - [git-url-parse]: https://github.com/retr0h/git-url-parse [Go]: https://go.dev @@ -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