release-please-action icon indicating copy to clipboard operation
release-please-action copied to clipboard

[Feature Request] Expose version data when release_created is false

Open amadkinnon opened this issue 3 years ago • 1 comments

It would be nice to know the version information to use in a workflow when a release is NOT created. For instance, building release candidate artifacts (v1.1.1-rc1) to push to QA. When the release is created, we would simply promote those artifacts to production instead of rebuilding.

Thoughts or another workflow solution?

amadkinnon avatar May 07 '21 13:05 amadkinnon

I don't know if this helps you but here's how I grab the version

steps:
  - uses: GoogleCloudPlatform/release-please-action@v2
    id: release
    with:
      token: ${{ secrets.GITHUB_TOKEN }}
      release-type: simple
      package-name: ${{ env.MOD_NAME }}
  - uses: actions/github-script@v3
    id: vars
    with:
      script: |
        const response = await github.pulls.get({
          pull_number: ${{ steps.release.outputs.pr }},
          owner: context.repo.owner,
          repo: context.repo.repo
        });
        core.info("\u001B[32m✔\u001B[39mBranch: \u001B[1;32m" + response.data.head.ref);
        core.setOutput("branch", response.data.head.ref);
    if: ${{ steps.release.outputs.pr && !steps.release.outputs.release_created }}
  - uses: actions/checkout@v2
    with:
      ref: ${{ steps.vars.outputs.branch }}
    if: ${{ steps.release.outputs.pr && !steps.release.outputs.release_created }}
  - if: ${{ steps.release.outputs.pr && !steps.release.outputs.release_created }}
    run: |
      version=$(cat ./version.txt)

I then use this info to add a commit to the release branch updating version numbers in various files.

live627 avatar Jun 10 '21 02:06 live627