diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3eae800 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +# .github/workflows/release.yml +name: goreleaser + +# suppress default golang toolchain +builds: +- skip: true #builds:skip suppress + +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: ${{ 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 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..4da56d1 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,92 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +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). +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