From 4b5f8faf0ab69e7354bc04f5aeff72a4c81e80ec Mon Sep 17 00:00:00 2001 From: Morgan Fainberg Date: Tue, 12 Dec 2023 15:11:14 -0800 Subject: [PATCH] Do not try and run release on PRs Do not try and run release on PRs --- .github/workflows/ci.yaml | 20 ++++++++++++-------- .goreleaser.yaml | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 061d4ee..aef5a50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: lint: name: "Lint" if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -46,16 +46,21 @@ jobs: run: CHECKONLY=1 script/format build: - name: "Build" - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + name: "Checkout" with: fetch-depth: 0 - uses: actions/setup-go@v5 + name: "Setup Go" with: go-version-file: go.mod - - run: make + - uses: goreleaser/goreleaser-action@v5 + name: "Build" + with: + version: latest + args: build --clean --snapshot release: runs-on: ubuntu-latest @@ -63,12 +68,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version-file: go.mod - - name: Build - run: make pget - - uses: goreleaser/goreleaser-action@v4 + - uses: goreleaser/goreleaser-action@v5 + if: startsWith(github.ref, 'refs/tags/') with: version: latest args: release --clean diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1f1b49c..50d8d97 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,7 +14,7 @@ builds: - arm64 main: ./main.go ldflags: - - "-s -w -X github.com/replicate/pget/pkg/version.Version={{.Version}} -X github.com/replicate/pget/pkg/version.CommitHash={{.Commit}} -X github.com/replicate/pget/pkg/version.BuildTime={{.Date}}" + - "-s -w -X github.com/replicate/pget/pkg/version.Version={{.Version}} -X github.com/replicate/pget/pkg/version.CommitHash={{.ShortCommit}} -X github.com/replicate/pget/pkg/version.BuildTime={{.Date}}" archives: - format: binary name_template: >-