create-release icon indicating copy to clipboard operation
create-release copied to clipboard

Feature request: Allow updating existing release

Open sondreb opened this issue 4 years ago • 8 comments

I have previously used a workflow where each build updates a draft release. This is especially important when running builds for Linux, Windows and Mac.

Running this script now, will result in 3 individual draft releases, making it not work with projects that is multi-platform. At least not without running some other script to check if the release already exists or not.

Updating an published release is not possible, I'm asking about draft here.

sondreb avatar Dec 25 '19 18:12 sondreb

Dup of #14

Ref #27

eine avatar Dec 25 '19 18:12 eine

Thanks @eine, could not find existing issue. I'm going through all of the available release actions on marketplace to see if any supports updates. Used a very good one on Azure DevOps (task: marcelo-formentao.github-tools.github-release-publish-task.GitHubReleasePublish), but that doesn't seem to be available for GitHub Actions.

sondreb avatar Dec 25 '19 18:12 sondreb

@sondred, I think it is ok to have multiple issues with different wordings/points of view, because this is a critical non-feature of GitHub Actions. As commented in https://github.com/actions/create-release/issues/23#issuecomment-555744071:

I believe that the main issue now is that there is no official solution provided by GitHub which is even close to the features available in other CI platforms with regard to uploading Assets and Releases. There is neither a monolithic solution nor a set of actions that can be combined programmatically. Without proper docs/READMEs, all these prototypes or proofs of concepts can be misleading for users migrating from other services.

eine avatar Dec 25 '19 18:12 eine

After testing many of the existing GitHub Actions for making GitHub releases, I could not find anyone that did what I needed, so I made my own.

It is not exactly a beauty, but if someone needs the specific workflow specified in the README, then it might be useful for someone.

  • It will create a new draft release if not exists.
  • It will create a new draft, even if there is a published release with the same tag.
  • It will update the content of the release and the assets, meaning it will delete and re-upload the files on each build. It will not clear old files if files are removed from the parameters. Just manually delete the release, and build again.
  • This easily supports using multiple builds for different platforms, and you can keep committing and running the workflow without getting multiple releases.

Not sure if it will ever reach the Marketplace, but it is available for use until some of the other actions maybe matures a bit more and gain more functionality:

https://github.com/sondreb/action-release

sondreb avatar Dec 26 '19 01:12 sondreb

I'm running a workflow that uses actions/upload-artifact@v2-preview to save the build for different platforms, then a final build step that uses actions/download-artifact to collect the builds and actions/create-release + actions/upload-release-asset to collect them into a single release. I think build artifacts are the best abstraction available for doing cross-platform collections. Maybe that can help your workflow. You can see this at: https://github.com/kousu/ANTs/blob/8a18cd9665ee8f0bcbfcf45b5bb6b3765012a1a3/.github/workflows/ccpp.yml

I additionally want to be able to update existing releases though! I want to do multiple builds, including seeing what the final release will look like, before signing off on it. I really really like your all-in-one action, and I would much rather use it than actions/create-release + actions/upload-release-asset and having to make a new draft release per ${{ github.run_id }} which I then have to go and delete once I've made the final version.

kousu avatar Apr 14 '20 20:04 kousu

Same problem, action fails on the existing release, which was created by the previous commit.

Run actions/create-release@v1 ##[error]Validation Failed: {"resource":"Release","code":"already_exists","field":"tag_name"}

kenorb avatar Jun 14 '20 20:06 kenorb

Works fine with: https://github.com/softprops/action-gh-release

kenorb avatar Jun 14 '20 21:06 kenorb

I also want to update/create a latest release with the latest pushed tag.

liudonghua123 avatar Oct 29 '20 00:10 liudonghua123