googleapis / release-please

generate release PRs based on the conventionalcommits.org spec
https://www.conventionalcommits.org
Apache License 2.0
4.68k stars 351 forks source link

Add a generic script-based release strategy #1139

Closed raphink closed 2 years ago

raphink commented 2 years ago

It would be useful to be able to launch a custom script from the GitHub repo to update specific files without having to create a new type of release strategy in release-please.

Something like:

 jobs:
   release-please:
     runs-on: ubuntu-latest
     steps:
       - uses: GoogleCloudPlatform/release-please-action@v2
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
           release-type: exec
           command: update-my-files.sh

The script would then receive the version number as parameter and be able to perform actions on the repository before release-please commits the files to the branch.

chingor13 commented 2 years ago

FYI, this might be difficult to accomplish. We generate the file changes in code and do not have a clone of the repository while creating the release pull request.

raphink commented 2 years ago

Thanks for your feedback @chingor13. I have 3 files I need to update with the version number:

Is there already a way to achieve this with release-please?

chingor13 commented 2 years ago

I don't see a great way right now, but 2 options moving forward.

  1. Implement the generic update class like #305
  2. Add a feature to let you arbitrarily add extra updaters (we have a TOML updater, and could build updaters for the other 2 file types) via path + updater. This one could be challenging, because some updaters have extra customizable arguments used.

Another option could be to use a manifest (multi-component) configuration with a plugin like the one requested in #1075. This would only work if the 3 files you want to update are in different directories though and would not be as globally applicable as options 1 and 2.