Skip to content

Improve local GoReleaser build process and development docs #1408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 16, 2025

Conversation

hslatman
Copy link
Member

@hslatman hslatman commented Apr 14, 2025

The goreleaser target has been adapted to allow for building CLI
releases that are very similar to the ones that we release as part of
our GitHub Actions release process. The target skips the hooks that
trigger binaries to be pushed to GCP, allowing the release process to
happen locally.

This PR also allows the GoReleaser process to be performed with
either its Pro or OSS version using a single config file.

Other changes in this PR:

  • Updated documentation for contributing to the step codebase
  • Replaced list of enabled linters with the current golangci-lint config
  • Enabled git data to be embedded into binary
  • Fixed some GoReleaser config deprecations
  • Fixed the GoReleaser Pro download URL for AMD64
  • Fixed some test cases that failed when ran using make test

Example build using Pro:

make goreleaser
  • by using this software you agree with its EULA, available at https://goreleaser.com/eula
  • running goreleaser v2.8.2
  • skipping after, post-hooks, and validate...
  • cleaning distribution directory
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=ece761143dd381180c19ce41096e5f300c432601 branch=herman/goreleaser-improvements current_tag=v0.28.6 previous_tag=v0.28.5 dirty=false
    • pipe skipped or partially skipped              reason=validation is disabled
  • parsing tag
  • setting defaults
  • partial
    • adjusting environment                          by=target target=darwin_arm64 dist=dist/darwin_arm64
  • snapshotting
    • building snapshot...                           version=v0.28.6-next
  • running before hooks
    • running hook                                   hook=go mod download
  • ensuring distribution directory
  • setting up metadata
  • writing release metadata
  • loading go mod information
  • build prerequisites
  • building binaries
    • partial build                                  filter=target=darwin_arm64_v8.0 matches=darwin_arm64_v8.0
    • building                                       binary=dist/darwin_arm64/default_darwin_arm64_v8.0/bin/step
  • setting up metadata
  • storing artifacts metadata
  • copying binary to "bin/step"
  • build succeeded after 3s
  • thanks for using GoReleaser Pro!

Example build using OSS:

make goreleaser
  • your configuration specifies  pro: true
    explanation=
    │ Your configuration is for GoReleaser Pro.
    │ You are currently using GoReleaser OSS, so all the Pro-only features will be ignored.
    │ Use GoReleaser Pro to enable all the features.
  • skipping post-hooks and validate...
  • cleaning distribution directory
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=ece761143dd381180c19ce41096e5f300c432601 branch=herman/goreleaser-improvements current_tag=v0.28.6 previous_tag=v0.28.5 dirty=false
    • pipe skipped or partially skipped              reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • partial
  • snapshotting
    • building snapshot...                           version=v0.28.6-next
  • running before hooks
    • running                                        hook=go mod download
  • ensuring distribution directory
  • setting up metadata
  • writing release metadata
  • loading go mod information
  • build prerequisites
  • building binaries
    • partial build                                  match=target=darwin_arm64_v8.0
    • building                                       binary=dist/default_darwin_arm64_v8.0/bin/step
  • writing artifacts metadata
  • copying binary to "bin/step"
  • build succeeded after 3s
  • thanks for using GoReleaser!

The new `goreleaser-local` target allows building CLI releases that
are very similar to the ones that we release as part of our GitHub
Actions release process. The target skips the hooks that trigger
binaries to be pushed to GCP, allowing the release process to happen
locally. Otherwise it's the same as the existing `goreleaser` target,
which is intended for local snapshot builds of the CLI binary.

This PR also allows the GoReleaser process to be performed with
either its Pro or OSS version.
@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Apr 14, 2025
See https://goreleaser.com/deprecations#archivesformat_overridesformat
for more info

Also fix error in Makefile documentation for the GORELEASER_SKIP
variable.
@hslatman hslatman force-pushed the herman/goreleaser-improvements branch from ece7611 to b42bf14 Compare April 14, 2025 12:16
@hslatman hslatman marked this pull request as ready for review April 14, 2025 12:20
@hslatman hslatman changed the title Improve local GoReleaser build process Improve local GoReleaser build process and development docs Apr 15, 2025
Depending on whether the test is executed in CI/VSCode vs. running
them locally with `make test`, the resulting error message was
different for the `multiple-select-ui` and `ignore-provisioner-flag`
test cases. For now we just test for an error, but it would be
nice to refactor a bit and trigger specific error cases in the
future.
@hslatman hslatman force-pushed the herman/goreleaser-improvements branch from 24664ca to b14f553 Compare April 15, 2025 12:59
@hslatman hslatman requested review from tashian, a team and dopey April 15, 2025 13:15
The new target isn't needed, as the existing `goreleaser` target
was created primarily for running it local and manually. There's
no need to push artifacts when running that target.
Copy link
Contributor

@tashian tashian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I tested this locally with goreleaser pro 2.8.2 and make.

@hslatman hslatman merged commit c4a4997 into master Apr 16, 2025
15 checks passed
@hslatman hslatman deleted the herman/goreleaser-improvements branch April 16, 2025 09:56
@hslatman hslatman added this to the v0.28.7 milestone Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants