From a06e68055cae1e740c0a1d7733947c8a8c4d2329 Mon Sep 17 00:00:00 2001 From: kass <28125260-gitkass@users.noreply.gitlab.com> Date: Fri, 14 Nov 2025 01:09:46 -0500 Subject: [PATCH 1/4] Add goreleaser action --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e6ec65d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +# .github/workflows/release.yml +name: goreleaser + +on: + pull_request: + push: + # run only against tags + tags: + - "*" + +permissions: + contents: write + # packages: write + # issues: write + # id-token: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + # More assembly might be required: Docker logins, GPG, etc. + # It all depends on your needs. + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + # 'latest', 'nightly', or a semver + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file From 3aa9a872783e4189809bae039615006a72ade130 Mon Sep 17 00:00:00 2001 From: kass <28125260-gitkass@users.noreply.gitlab.com> Date: Fri, 14 Nov 2025 01:13:20 -0500 Subject: [PATCH 2/4] Setup goreleaser --- .gitignore | 2 ++ .goreleaser.yaml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.gitignore b/.gitignore index 99370b1..26d0323 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .direnv .task +# Added by goreleaser init: +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..b3bc88e --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,53 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +# before: +# hooks: +# # You may remove this if you don't use go modules. +# - go mod tidy +# # you may remove this if you don't need go generate +# - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - formats: [tar.gz] + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + formats: [zip] + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +release: + footer: >- + + --- + + Released by [GoReleaser](https://github.com/goreleaser/goreleaser). From 507b60253fd13eb37b6ba72360896d19f93db293 Mon Sep 17 00:00:00 2001 From: kass <28125260-gitkass@users.noreply.gitlab.com> Date: Fri, 14 Nov 2025 01:20:27 -0500 Subject: [PATCH 3/4] configure goreleaser --- .goreleaser.yaml | 57 ++++++++++++++++++++++++++++++++++++++++-------- Taskfile.yml | 4 +++- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b3bc88e..4da56d1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,20 +1,11 @@ # This is an example .goreleaser.yml file with some sensible defaults. # Make sure to check the documentation at https://goreleaser.com -# The lines below are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj version: 2 -# before: -# hooks: -# # You may remove this if you don't use go modules. -# - go mod tidy -# # you may remove this if you don't need go generate -# - go generate ./... - builds: - env: - CGO_ENABLED=0 @@ -51,3 +42,51 @@ release: --- Released by [GoReleaser](https://github.com/goreleaser/goreleaser). +source: + enabled: true + + # Name template of the final archive. + # + # Default: '{{ .ProjectName }}-{{ .Version }}'. + # Templates: allowed. + name_template: "{{ .ProjectName }}-{{ .Version }}" + + # Format of the archive. + # + # Valid formats are: tar, tgz, tar.gz, and zip. + # + # Default: 'tar.gz'. + format: "tgz" + + # Prefix. + # String to prepend to each filename in the archive. + # + # Templates: allowed. + prefix_template: "{{ .ProjectName }}-{{ .Version }}/" + + # Additional files/globs you want to add to the source archive. + # + # Templates: allowed. + files: + - LICENSE.txt + - README_{{.Os}}.md + - CHANGELOG.md + - docs/* + - design/*.png + - templates/**/* + # a more complete example, check the globbing deep dive below + - src: "*.md" + dst: docs + + # Strip parent directories when adding files to the archive. + strip_parent: true + + # File info. + # Not all fields are supported by all formats available formats. + # Default: file info of the source file. + info: + owner: root + group: root + mode: 0644 + # format is `time.RFC3339Nano` + mtime: 2008-01-02T15:04:05Z diff --git a/Taskfile.yml b/Taskfile.yml index ebf4a6a..666f2f6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -46,4 +46,6 @@ tasks: - '**/*.go' - .golangci.yml - check: \ No newline at end of file + check: + cmds: + - goreleaser check \ No newline at end of file From 4bf2cd679190689f1eeca7391dc15595544f8733 Mon Sep 17 00:00:00 2001 From: kass <28125260-gitkass@users.noreply.gitlab.com> Date: Sat, 15 Nov 2025 02:21:36 -0500 Subject: [PATCH 4/4] config https://goreleaser.com/cookbooks/release-a-library/ --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6ec65d..3eae800 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,10 @@ # .github/workflows/release.yml name: goreleaser +# suppress default golang toolchain +builds: +- skip: true #builds:skip suppress + on: pull_request: push: @@ -37,6 +41,6 @@ jobs: version: "~> v2" args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrerets.GITHUB_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file