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

Promoting draft release #25

Open
aymericbeaumet opened this issue Apr 17, 2023 · 2 comments
Open

Promoting draft release #25

aymericbeaumet opened this issue Apr 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@aymericbeaumet
Copy link

aymericbeaumet commented Apr 17, 2023

I'm trying to implement the following workflow:

  1. Create a draft release
  2. Build and publish to the registries
  3. Publish the release by promoting the draft as the final release

I've tried the following, but the draft release is overriden:

jobs:
  begin-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          draft: true
          token: ${{ secrets.GITHUB_TOKEN }}

  # other jobs

  finish-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          draft: false
          token: ${{ secrets.GITHUB_TOKEN }}

Do you have any suggestion as to how to approach this draft -> publish promotion?

@taiki-e
Copy link
Owner

taiki-e commented Apr 17, 2023

Currently, this action only supports creating a new release or overwriting an existing release (#5), but I'm okay with adding support for updating an existing release.

That said, the following single command should probably be enough to do this:

- run: gh release edit "${GITHUB_REF#refs/tags/}" --draft=false
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

See also GitHub CLI docs.

@aymericbeaumet
Copy link
Author

I've tried your solution with the GitHub CLI, and it worked like a charm. Thanks!

I think adding support for updating an existing release would make sense to keep things abstracted under the same GitHub actions. But I would not consider it a high priority.

@taiki-e taiki-e added the enhancement New feature or request label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants