Skip to content

Commit

Permalink
Remove go tidy from release step (carvel-dev#732)
Browse files Browse the repository at this point in the history
* Remove go tidy from release step

Bump goreleaser to the latest version

Signed-off-by: João Pereira <joaod@vmware.com>

* Specify the tag being used for a release

Signed-off-by: João Pereira <joaod@vmware.com>

---------

Signed-off-by: João Pereira <joaod@vmware.com>
  • Loading branch information
joaopapereira authored May 4, 2023
1 parent b75689a commit 0ffc5fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.19.5
- name: Retrieve version
run: |
echo "TAG_NAME=$(echo ${{ github.ref }} | grep -Eo 'v[0-9].*')" >> $GITHUB_OUTPUT
id: version

- name: Run GoReleaser
# GoReleaser v2.5.0
uses: goreleaser/goreleaser-action@5e15885530fb01d81d1f24e8a6f54ebbd0fed7eb
# GoReleaser v4.2.0
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b
if: startsWith(github.ref, 'refs/tags/')
with:
version: 0.184.0
version: 1.16.2
args: release --rm-dist --debug ${{ env.SKIP_PUBLISH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}

- uses: actions/github-script@v4
id: get-checksums-from-draft-release
Expand Down Expand Up @@ -85,9 +90,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
CURRENT_TAG: ${{ steps.version.outputs.TAG_NAME }}
run: |
set -e -x
VERSION=`echo ${{ github.ref }} | grep -Eo '[0-9].*'`
VERSION=`echo "$CURRENT_TAG" | grep -Eo '[0-9].*'`
./hack/build-binaries.sh "$VERSION" > ./go-checksums
cat ./go-checksums
Expand Down
5 changes: 0 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go fmt ./cmd/... ./pkg/... ./test/...
- go mod vendor
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
Expand Down
6 changes: 1 addition & 5 deletions hack/build-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ function get_latest_git_tag {
git describe --tags | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'
}

VERSION="${1:-`get_latest_git_tag`}"

go fmt ./cmd/... ./pkg/... ./test/...
go mod vendor
go mod tidy
VERSION="${1:-$(get_latest_git_tag)}"

# makes builds reproducible
export CGO_ENABLED=0
Expand Down

0 comments on commit 0ffc5fc

Please sign in to comment.