stateful / runme

DevOps Notebooks Built with Markdown
https://runme.dev
Apache License 2.0
1.17k stars 38 forks source link

Update goreleaser and fix deprecation notices #122

Open adambabik opened 1 year ago

adambabik commented 1 year ago

When creating a new release called v0.5.0-rc.0, I noticed the following warning about deprecated flags and properties:

Flag --rm-dist has been deprecated, please use --clean instead
  • starting release...
  • loading config file                              file=.goreleaser.yml
    • DEPRECATED: --rm-dist was deprecated in favor of --clean, check https://goreleaser.com/deprecations#-rm-dist for more details
  • loading environment variables
    • using token from "$GITHUB_TOKEN"
  • getting and validating git state
    • building...                                    commit=4793b5bb28bc2a0bc37490f9a2b486460bf3e[32](https://github.com/stateful/runme/actions/runs/4136223083/jobs/7149775270#step:8:33)3 latest tag=v0.5.0-rc.0
  • parsing tag
  • setting defaults
      • DEPRECATED: `archives.rlcp` will be the default soon, check https://goreleaser.com/deprecations#archivesrlcp for more info
      • DEPRECATED: `archives.replacements` should not be used anymore, check https://goreleaser.com/deprecations#archivesreplacements for more info
      • DEPRECATED: `nfpms.replacements` should not be used anymore, check https://goreleaser.com/deprecations#nfpmsreplacements for more info

Follow the links about deprecations and change the code accordingly.

MusabShakeel576 commented 1 year ago

Hi @adambabik, this issue seems like a good-first-issue to me and I'm willing to work on it.

I ran make release by following contributing guide and I didn't get any warnings for the v0.6.0-rc.1 release, are you running the same command, or are you passing some arguments or using other commands with it like git tag?

Could you confirm that this issue still exists for you, if yes then the first warning of --rm-dist is in Makefile and can be resolved by just replacing it with goreleaser release --snapshot --clean as shown in the warning, I'll make a PR for it and also take a look at other deprecation warnings under "setting defaults" (btw these warnings are also not appearing on my side).

adambabik commented 1 year ago

Hi @MusabShakeel576! Thank you for your interest in our project. Contributions are highly welcome!

I ran make release by following contributing guide and I didn't get any warnings for the v0.6.0-rc.1 release, are you running the same command, or are you passing some arguments or using other commands with it like git tag?

It's a goreleaser version issue. There is a hardcoded version in our Makefile, but the release pipeline uses a Github Action named goreleaser/goreleaser-action@v2, which probably uses the latest goreleaser available. You can reproduce all of them by changing the install/goreleaser target body to:

go install github.com/goreleaser/goreleaser@latest

It would be great to pin the version inside the release pipeline as well.

MusabShakeel576 commented 1 year ago

@adambabik yeah it's now throwing warnings after changing install/goreleaser target command to latest.

So if the warning is currently appearing in the cd pipeline and you want to pin the version then we can just swap version: latest with version: v1.10.2 in release file?

adambabik commented 1 year ago

@MusabShakeel576 Let's upgrade it and pin it to the latest release available in both places.

MusabShakeel576 commented 1 year ago

@adambabik alright.