Skip to content

Commit

Permalink
Fix unreliable asset generation (#1235)
Browse files Browse the repository at this point in the history
The goal of this change is to fix the symptoms described in the
following two issues:
- #1234
- #1059

It seems the goreleaser action that was triggered by the 1.2.1 tag
thought that the current tag was 1.2.1.SNAPSHOT.0
```
git state    commit=7b06248484ceeaa947e93ca2747eccf336a88ecc branch=HEAD current_tag=v1.2.1-SNAPSHOT.0 previous_tag=v1.2.0
```
Source:
https://github.com/bufbuild/protoc-gen-validate/actions/runs/12916704001/job/36021453853#step:5:21

Basically we ended up with two tags pointing at the same commit and
goreleaser picked one:
goreleaser/goreleaser#4134

We were unnecessarily increasing the likelihood of that happening by
force fetching all tags (which is unnecessary because we will already
have the intended tag fetched that triggered the push), so I removed
that step here:
87dc0be

Additionally, I don't think there is any value in having snapshot tags
at all so I deleted the entire version bump workflow here:
79a4a4f

Furthermore, we had goreleaser configured to publish drafts, which
doesn't make sense if we want to initiate release from the GitHub UI
(which I think we do and is similer/easier) so I deleted all the extra
config here:
56f26d0
The default config is the right thing for us.

Finally there were some settings in setup-go we had configured that have
no effect now, so I removed them:
33528d7
  • Loading branch information
nicksnyder authored Jan 23, 2025
1 parent 3741177 commit a11b03b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 323 deletions.
229 changes: 0 additions & 229 deletions .github/actions/github-tag-action/entrypoint.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
use-latest: true
cache: true
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/version-bump.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,3 @@ builds:
binary: "protoc-gen-validate-java"
env:
- CGO_ENABLED=0

release:
# If set to true, will not auto-publish the release.
# Available only for GitHub and Gitea.
# Default is false.
draft: true

# Whether to remove existing draft releases with the same name before creating a new one.
# Only effective if `draft` is set to true.
# Available only for GitHub.
#
# Default: false.
# Since: v1.11.
replace_existing_draft: true

# Useful if you want to delay the creation of the tag in the remote.
# You can create the tag locally, but not push it, and run GoReleaser.
# It'll then set the `target_commitish` portion of the GitHub release to the value of this field.
# Only works on GitHub.
#
# Default: empty.
# Since: v1.11.
target_commitish: "{{ .Commit }}"

# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
# Default is false.
prerelease: auto

# What to do with the release notes in case there the release already exists.
#
# Valid options are:
# - `keep-existing`: keep the existing notes
# - `append`: append the current release notes to the existing notes
# - `prepend`: prepend the current release notes to the existing notes
# - `replace`: replace existing notes
#
# Default is `keep-existing`.
mode: keep-existing

# You can change the name of the release.
# Default is `{{.Tag}}` on OSS and `{{.PrefixedTag}}` on Pro.
name_template: "{{.Tag}}"

0 comments on commit a11b03b

Please sign in to comment.