From 722b853a7eaf27fa39978363724bd236f91e0526 Mon Sep 17 00:00:00 2001 From: Grant Linville Date: Mon, 23 Sep 2024 15:26:09 -0400 Subject: [PATCH] fix: set up goreleaser and workflows properly (#5) Signed-off-by: Grant Linville --- .github/workflows/.goreleaser.yml | 0 .github/workflows/{build.yml => build.yaml} | 4 +-- .github/workflows/release.yaml | 32 +++++++++++++++++++++ .goreleaser.yml | 13 +++++---- 4 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/.goreleaser.yml rename .github/workflows/{build.yml => build.yaml} (84%) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/.goreleaser.yml b/.github/workflows/.goreleaser.yml new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 84% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml index 1d65a1b..59f9dd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yaml @@ -32,6 +32,4 @@ jobs: with: distribution: goreleaser version: "~> v2" - args: release --clean --snapshot -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + args: release --clean --snapshot \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..76811b1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + release-tag: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + cache: false + go-version: "1.23" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ github.ref_name }} diff --git a/.goreleaser.yml b/.goreleaser.yml index e166240..958d297 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,9 @@ builds: binary: gptscript-credential-sqlite env: - CGO_ENABLED=0 + goos: + - linux + - darwin goarch: - amd64 - arm64 @@ -16,16 +19,14 @@ builds: ldflags: - -s - -w - - -X "github.com/gptscript-ai/gptscript/pkg/version.Tag=v{{ .Version }}" archives: - - id: default + # Disable archives, we just want the binaries + - id: no_archives + format: binary + name_template: "gptscript-credential-sqlite-{{ .Os }}-{{ .Arch }}" builds: - default - name_template: 'gptscript-credential-sqlite-v{{ .Version }}-{{ .Os }}-{{ .Arch }}' - format_overrides: - - goos: windows - format: zip checksum: name_template: "checksums.txt"