Skip to content
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

feat(release): version based on github release tag #3049

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

nitrocode
Copy link
Member

@nitrocode nitrocode commented Jan 26, 2023

what

  • Set version based on github release tag
  • Set kustomize version to latest
  • Set rlcp explicitly in .goreleaser.yaml

why

  • Prevent having to do manual PRs right before a release by passing in the tag version to goreleaser automatically
  • set kustomize to our stable version latest to avoid manual bumps
  • set rlcp to avoid deprecation for december 2023

tests

  • I have tested my changes by checking this in a fork

references

Validate goreleaser config

✗ goreleaser check
  • loading config file                              file=.goreleaser.yml
  • checking config...
  • config is valid

From the action in fork

Run goreleaser/goreleaser-action@v4
Downloading https://github.com/goreleaser/goreleaser/releases/download/v0.183.0/goreleaser_Linux_x86_64.tar.gz
Extracting GoReleaser
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/8577ded7-9a2b-4840-a39e-cfc6d1585df8 -f /home/runner/work/_temp/9c5966e3-718b-4bc4-9fc2-aa6bdf295ff2
GoReleaser v0.183.0 installed successfully
/opt/hostedtoolcache/goreleaser-action/0.183.0/x64/goreleaser release --rm-dist
   • releasing...     
   • loading config file       file=.goreleaser.yml
   • loading environment variables
   • getting and validating git state
      • building...               commit=9f50c6f0c382e516380617bf0f8bb323fba63789 latest tag=v0.22.9000

If this is run from the command line using goreleaser

✗ goreleaser build --rm-dist --snapshot --single-target
./dist/atlantis_darwin_amd64_v1/atlantis version
✗ atlantis 0.22.4-next, commit 9b0be50e889f5446394367b953623ea13ee44df5, built at 2023-01-26T00:50:21Zatlantis 0.22.4-next

If this is run from the command line using go build with the version explicitly added

✗ go build -v -ldflags "-X 'main.version=whosyourdaddy'" -o atlantis .
✗ ./atlantis version
github.com/runatlantis/atlantis
atlantis whosyourdaddy

@nitrocode nitrocode requested a review from a team as a code owner January 26, 2023 00:46
@github-actions github-actions bot added github-actions go Pull requests that update Go code labels Jan 26, 2023
@nitrocode nitrocode added this to the v0.23.0 milestone Jan 26, 2023
@nitrocode nitrocode enabled auto-merge (squash) January 26, 2023 00:57
@nitrocode nitrocode merged commit 89ccb86 into main Jan 26, 2023
@nitrocode nitrocode deleted the version-based-on-tag branch January 26, 2023 01:03
Copy link
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github-actions go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate releases without a manual PR prior to release
3 participants