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

Cannot disable release body append mechanism when updating an existing release

Open matusnovak opened this issue 3 years ago • 8 comments

If you update the release from multiple jobs then the body is appended and the behavior cannot be controlled. Here is where the problem is: https://github.com/softprops/action-gh-release/blob/master/src/github.ts#L171

Why is this a problem?

Some projects need to be built on multiple architectures and multiple operating systems. For example, compile on x64-windows, x86-windows, x64-linux, x64-osx. Such project is run on 4 different jobs, uses a matrix configuration -> each job creates a release with a unique artifact.

What I want to accomplish is to have a single release with multiple binaries for the same architecture with git log as the body of the release. But instead I get this:

image

My config looks like this:

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          body: ${{ steps.create_changelog.outputs.log }} # comes from "git log"
          files: ${{ steps.create_artifact.outputs.path }}
          draft: false
          prerelease: false
          name: Release ${{ steps.get_release_name.outputs.tag }}
          tag_name: ${{ steps.get_release_name.outputs.tag }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Would it be possible to implement something like this?

with:
  append: false

matusnovak avatar Jul 04 '20 15:07 matusnovak

That seems doable, yes

Some projects need to be built on multiple architectures and multiple operating systems. For example, compile on x64-windows, x86-windows, x64-linux, x64-osx. Such project is run on 4 different jobs, uses a matrix configuration -> each job creates a release with a unique artifact.

A few alternatives that require no change to to this action

  • You could leverage upload and download artifacts actions. Have multiple jobs that build release artifacts use upload-artifact then in a separate job that depends on those, download the artifacts and run the gh release action just once

  • use an if filter to conditionally set release notes for one of your architectures assuming all release notes are the same and an flipped if for the remainder

softprops avatar Jul 04 '20 19:07 softprops

[...] then in a separate job that depends on those, download the artifacts and run the gh release action just once

That sounds like a good idea. Thanks!

matusnovak avatar Jul 04 '20 19:07 matusnovak

you bet. let me know if you need help on how to structure that

softprops avatar Jul 04 '20 19:07 softprops

Any update? I really need this feature.

abcfy2 avatar Nov 07 '20 05:11 abcfy2

I totally agree. This feature would be great.

orhun avatar Nov 22 '20 23:11 orhun

@abcfy2 @orhun

The original use case mentioned in this issue is solved by the upload / download pattern.

Is there another motivating use case for this feature?

movermeyer avatar Oct 22 '21 12:10 movermeyer

@abcfy2 @orhun

The original use case mentioned in this issue is solved by the upload / download pattern.

Is there another motivating use case for this feature?

Thanks for letting me know. Honestly, I don't remember what I was trying to do at that time (almost a year ago) so I don't really know 🙈

orhun avatar Oct 24 '21 18:10 orhun

My use case is that my artifacts are large (100Mb - 200Mb each). Having 3 of them will get me over my free 500Mb limit when using upload/download artifacts.

I will use the if statement approach to create release-notes only for one build.

robkooper avatar Oct 31 '21 22:10 robkooper