From 0cbd9a1b5757e3b30e1e8e6e0c604309c20bfda7 Mon Sep 17 00:00:00 2001 From: Gregory Horvath Date: Sat, 2 Nov 2024 13:52:01 -0400 Subject: [PATCH] add releaser --- .github/workflows/release.yaml | 30 ++++++++++++++++++ .goreleaser.yaml | 56 ++++++++++++++++++++++++++++++++++ cspell.json | 6 +++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..b3eaaf1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v4 + with: + go-version: stable + + - uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..375397d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,56 @@ +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + main: ./cmd/grimoire + binary: grimoire + ldflags: + - -s -w -X main.version={{.Version}} + +brews: + - repository: + owner: gphorvath + name: homebrew-tap + token: "{{ .Env.GITHUB_TOKEN }}" + homepage: https://github.com/gphorvath/grimoire + description: A prompt engineer's Grimoire to assist with getting the best results from Generative AI prompts + license: MIT + test: | + system "#{bin}/grimoire --version" + install: | + bin.install "grimoire" + +nfpms: + - file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + homepage: https://github.com/gphorvath/grimoire + description: A prompt engineer's Grimoire to assist with getting the best results from Generative AI prompts + maintainer: Gregory Horvath + license: MIT + formats: + - deb + - rpm + dependencies: + - git + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + - '^ci:' \ No newline at end of file diff --git a/cspell.json b/cspell.json index 3200bd4..db05d39 100644 --- a/cspell.json +++ b/cspell.json @@ -11,13 +11,17 @@ "commitlint", "coverprofile", "dylib", + "goarch", "gphorvath", "Grimoire", "Horvath", + "incpatch", + "ldflags", "lycheeignore", + "nfpms", "trufflehog", "trufflesecurity" ], "ignoreWords": [], "import": [] -} \ No newline at end of file +}