GithubHelp home page GithubHelp logo

softprops / action-gh-release Goto Github PK

View Code? Open in Web Editor NEW
3.6K 23.0 418.0 2.71 MB

πŸ“¦ :octocat: GitHub Action for creating GitHub Releases

License: MIT License

TypeScript 99.17% JavaScript 0.83%
github-actions github-releases

action-gh-release's Introduction

πŸ“¦ :octocat:

action gh-release

A GitHub Action for creating GitHub Releases on Linux, Windows, and macOS virtual environments


🀸 Usage

πŸš₯ Limit releases to pushes to tags

Typically usage of this action involves adding a step to a build that is gated pushes to git tags. You may find step.if field helpful in accomplishing this as it maximizes the reuse value of your workflow for non-tag pushes.

Below is a simple example of step.if tag gating

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Release
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')

You can also use push config tag filter

name: Main

on:
  push:
    tags:
      - "v*.*.*"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Release
        uses: softprops/action-gh-release@v2

⬆️ Uploading release assets

You can configure a number of options for your GitHub release and all are optional.

A common case for GitHub releases is to upload your binary after its been validated and packaged. Use the with.files input to declare a newline-delimited list of glob expressions matching the files you wish to upload to GitHub releases. If you'd like you can just list the files by name directly.

Below is an example of uploading a single asset named Release.txt

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Build
        run: echo ${{ github.sha }} > Release.txt
      - name: Test
        run: cat Release.txt
      - name: Release
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: Release.txt

Below is an example of uploading more than one asset with a GitHub release

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Build
        run: echo ${{ github.sha }} > Release.txt
      - name: Test
        run: cat Release.txt
      - name: Release
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            Release.txt
            LICENSE

⚠️ Note: Notice the | in the yaml syntax above ☝️. That lets you effectively declare a multi-line yaml string. You can learn more about multi-line yaml syntax here

⚠️ Note for Windows: Paths must use / as a separator, not \, as \ is used to escape characters with special meaning in the pattern; for example, instead of specifying D:\Foo.txt, you must specify D:/Foo.txt. If you're using PowerShell, you can do this with $Path = $Path -replace '\\','/'

πŸ“ External release notes

Many systems exist that can help generate release notes for you. This action supports loading release notes from a path in your repository's build to allow for the flexibility of using any changelog generator for your releases, including a human πŸ‘©β€πŸ’»

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Generate Changelog
        run: echo "# Good things have arrived" > ${{ github.workspace }}-CHANGELOG.txt
      - name: Release
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          body_path: ${{ github.workspace }}-CHANGELOG.txt
          repository: my_gh_org/my_gh_repo
          # note you'll typically need to create a personal access token
          # with permissions to create releases in the other repo
          token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

πŸ’… Customizing

inputs

The following are optional as step.with keys

Name Type Description
body String Text communicating notable changes in this release
body_path String Path to load text communicating notable changes in this release
draft Boolean Indicator of whether or not this release is a draft
prerelease Boolean Indicator of whether or not is a prerelease
files String Newline-delimited globs of paths to assets to upload for release
name String Name of the release. defaults to tag name
tag_name String Name of a tag. defaults to github.ref
fail_on_unmatched_files Boolean Indicator of whether to fail if any of the files globs match nothing
repository String Name of a target repository in <owner>/<repo> format. Defaults to GITHUB_REPOSITORY env variable
target_commitish String Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch.
token String Secret GitHub Personal Access Token. Defaults to ${{ github.token }}
discussion_category_name String If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "Managing categories for discussions in your repository."
generate_release_notes Boolean Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes. See the GitHub docs for this feature for more information
append_body Boolean Append to existing body instead of overwriting it
make_latest String Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Can be true, false, or legacy. Uses GitHub api defaults if not provided

πŸ’‘ When providing a body and body_path at the same time, body_path will be attempted first, then falling back on body if the path can not be read from.

πŸ’‘ When the release info keys (such as name, body, draft, prerelease, etc.) are not explicitly set and there is already an existing release for the tag, the release will retain its original info.

outputs

The following outputs can be accessed via ${{ steps.<step-id>.outputs }} from this action

Name Type Description
url String Github.com URL for the release
id String Release ID
upload_url String URL for uploading assets to the release
assets String JSON array containing information about each uploaded asset, in the format given here (minus the uploader field)

As an example, you can use ${{ fromJSON(steps.<step-id>.outputs.assets)[0].browser_download_url }} to get the download URL of the first asset.

environment variables

The following step.env keys are allowed as a fallback but deprecated in favor of using inputs.

Name Description
GITHUB_TOKEN GITHUB_TOKEN as provided by secrets
GITHUB_REPOSITORY Name of a target repository in <owner>/<repo> format. defaults to the current repository

⚠️ Note: This action was previously implemented as a Docker container, limiting its use to GitHub Actions Linux virtual environments only. With recent releases, we now support cross platform usage. You'll need to remove the docker:// prefix in these versions

Permissions

This Action requires the following permissions on the GitHub integration token:

permissions:
  contents: write

When used with discussion_category_name, additional permission is needed:

permissions:
  contents: write
  discussions: write

GitHub token permissions can be set for an individual job, workflow, or for Actions as a whole.

Note that if you intend to run workflows on the release event (on: { release: { types: [published] } }), you need to use a personal access token for this action, as the default secrets.GITHUB_TOKEN does not trigger another workflow.

Doug Tangren (softprops) 2019

action-gh-release's People

Contributors

abcfy2 avatar alerque avatar aronchick avatar artfisica avatar bacongravy avatar briantist avatar csexton avatar danepowell avatar deining avatar dependabot[bot] avatar filips123 avatar fredemmott avatar k-takata avatar kevingentile avatar kubukoz avatar loicalbertin avatar nalexpear avatar ncfavier avatar olidacombe avatar past-due avatar pauleve avatar playpauseandstop avatar ppd avatar rhalaly avatar softprops avatar takmr avatar tesaguri avatar thomaspiskol avatar xt0rted avatar yin1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-gh-release's Issues

Super confused by the glob

Hello πŸ‘‹

Thanks for this GitHub Actions!

I'm testing it today but I got super confused by the glob:

image

It's a private repository so I can't really show more than that. But you see that I use archive/*.zip and the glob failed to found it. But on the other hand I did ls -l archive/*.zip just before and it worked. This seems very strange.

Can't seem to meet tag requirement

I'm using a local copy of your action for reasons, however, I can't seem to get the script to be happy with a tag that I'm setting.
The Workflow fires on:push and on:pull_request. I want to create a tag during the workflow sequence based on some environment variables. I can't seem to set the tag (git tag ${GITHUB_TAG}) in a proper location within the workflow so that your script can pick it up.
I see that some commands require a push of the tag, but that would likely result in an infinite loop of workflow runs, which would be bad.
I hope you can point me at the obvious thing that I'm not seeing.

Option to fail on existing tag

Hi! We are using action-gh-release to release our packages and create release tags. We want to prevent an accidental situation of releasing the same version again. I'm using now scripts that check if the tag exists and fails if so, but it would be so much more convenient to have just an option for it in this gh action!

GitHub Releases requires a tag

I keep getting this error that my git tag has not been set, tried multiple ways to do that from the command line and from bash inside of the action. Could not get promising results hence this issue.

Here is my main.yaml

name: Fast Builds

on: [push]

jobs:
build:

  runs-on: ubuntu-latest
  
  steps:
  - uses: actions/checkout@v1
  - uses: actions/setup-java@v1
    with:
      java-version: '12.x'
  - uses: subosito/flutter-action@v1
    with:
      channel: 'stable'      
  - run: flutter doctor
  - run: flutter pub get
  - run: flutter build apk
  - name: Display the path
    run: |
      echo ${PATH}
      git tag 0.0.1
      echo "wow"
    shell: bash
#     -name: Debug Info
#      shell: bash
#      run: |
#         GITHUB_TAG = "0.0.1"
#         git tag ${GITHUB_TAG}
#         echo "Release Tag :   ${GITHUB_TAG}"
  - name: Release To Git
    uses: softprops/action-gh-release@v1
#       if: startsWith(github.ref, 'refs/tags/')
    with: 
      body: "A new release"
      files: build/app/outputs/apk/release/app-release.apk
    env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The field body_path is not working

I try to use the body_path but it does not shows in the release body. My configuration is as follows

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Build
        run: echo ${{ github.sha }} > Release.txt
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          body_path: Release.txt
          prerelease: false
          files: |
            Release.txt
            LICENSE
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I try using different paths but with any success. Am I doing anything wrong?

Thanks in advance

Not upload file to release

My config as follow:

name: Release
on:
  push:
    tags:
      - "release-v*"

jobs:
  release-to-gitHub:
    name: Release to github
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Asseble release
        run: |
          ./gradlew app:assembleRelease --info
          cp app/build/outputs/apk/release/app-release.apk ${GITHUB_REF:10}.apk
      - name: Upload
        uses: softprops/action-gh-release@v1
        with:
          files: ${GITHUB_REF:10}.apk
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Runtime log:

Run softprops/action-gh-release@v1
πŸ‘©β€πŸ­ Creating new GitHub release for tag release-v1.0.2...
πŸŽ‰ Release ready at https://github.com/stefanJi/dots365/releases/tag/release-v1.0.2

But release not file. See https://github.com/stefanJi/dots365/releases/tag/release-v1.0.2

[FEATURE] Add the ability to set release name

Hi.
Thanks for a plugin, it works like a charm.

I've successfully migrated my project from TravisCI to GitHub Actions with your plugin.
TravisCI have option for setting release name.
I've used it in my pipeline and got a release with human-readable name, e.g.

I didn't find such an option in your plugin but I hope it's possible to realize in GitHub Actions,
Here is a tag deployed with you plugin.

Thank you.

Bad credentials (ubuntu-latest)

See example. This github action doesn't work at all...

Seems to be like (closed) #12.

BTW, full yml snippet, that uses your software in my case:

    - name: Publish on Github Releases
      uses: softprops/action-gh-release@v1
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: dist/*
        draft: true
        prerelease: true
        name: "Diofant ${VERSION}"
        body: "See [release notes](https://diofant.readthedocs.io/\
               en/latest/release/notes-${SHORT_VERSION}.html)."

Unhelpful error message during failure: `GitHub release failed with status: undefined`

While doing some test runs, I have been consistently encountering the same error, but have been having a difficult time troubleshooting it due to the unhelpful error.

⚠️ GitHub release failed with status: undefined, retrying...

This persists until the API rate limit is exceeded.

image

Here's an example run: https://github.com/matchai/test-rust-actions/runs/244631334

Suggestions:

  • It might be useful to log the full error object if error.status is nully.
  • It would be nice if there was a retry limit, or a backoff of sorts. It is retrying 100 times in 15 seconds, making users unable to fix the problem and retry due to API limits being exceeded

[Question] Compose for Desktop Multiplatform release

Hey I just am checking out this action and wonder the following.
Is it possible to have three build steps (each for a different OS) and at the end have those three distribution artifacts (*.msi, *.deb, *.macstuff) available to being included in one release?

Atm. from what I understand of the action is that it only works for 1 build to 1 release. In my case I need 3 builds to 1 release. I am not very fresh with Github Actions. Maybe there is a way to merge the artifacts of all three previous builds into one release step?

Release do 'not include valid file', but action passed anyway

I had the following error:

image

where the filename was invalid, however it didn't fail the action it-self.

I'm aware the filename was invalid, which was my mistake, however I guess the expected behaviour is to fail the step on such error, but instead it's green (which can be challenge to notice that something went wrong).

Support release asset merging

Now you can't update assets of the same release from different jobs. If you try to execute this action two or more times for the same release it will just silently fail with unhandled rejections.

Desired behavior: if release already exists, then just upload files from files section.

support loading release body from a file

there's really only so much you can do inside a string literal but leveraging another action to generate the contents of the body stored in a file this action could source from is limitless

[Security] Update @actions/core to 1.2.6

See blog post: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Action authors who are using the toolkit should update the @actions/core package to v1.2.6 or greater to get the updated addPath and exportVariable functions.

Action and workflow authors who are setting environment variables via STDOUT should update any usage of the set-env and add-path workflow commands to use the new environment files.

If you need to log untrusted information such as issue titles, bodies, or commit messages to STDOUT we recommend that you disable command processing prior to doing that.

Upload faling on windows-latest with EBUSY

I'm using this action to release binaries from a matrix CI workflow building on macOS, linux and windows. The windows job is failing with the following error:
EBUSY: resource busy or locked, lstat 'D:\pagefile.sys'
image

The other two are working just fine. Is action-gh-release supported on a windows build?

Support environment variables and bash expressions in file names

It would be great to be able to use environment variables and the output of bash expressions like below:

- name: Prepare GitHub Release
  run: mv some.file some.file-$GITHUB_SHA-$(git describe --tags --exact-match)
- name: Release to GitHub Releases
  uses: docker://softprops/action-gh-release
  if: startsWith(github.ref, 'refs/tags/')
  with:
    files: some.file-$GITHUB_SHA-$(git describe --tags --exact-match)
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Merge two Github releases from build matrix output?

First of all thanks for the awesome action! Works like a charm!

I am currently using GItHub actions to build an (ionic cordova) mobile app which is built on linux (android apk) and mac (ios) in a matrix and upload the asset to Gi
Unfortunately when the jobs finish, I have a separate release for each asset.
I don't know if the api allows this, but would it be somehow possible to merge the releases into one?

Do not retry on 422 error from GitHub API

Hi,

First of all, thanks for useful action, it helps a lot.

However, I found pretty scary issue, while provide invalid tag_name, it results in ~500 retries to GitHub API and as result rate-limiting my installation ID to make any other requests to GitHub API,

Screenshot 2020-05-18 at 19 29 42

As you see at screenshot below softprops/action-gh-release action retries after each 422 error response from GitHub API, but it is unexpected behaviour at all, as in the end it results in HttpError: API rate limit exceeded for installation ID 7068452 error.

I propose to not retry after 422 error from GitHub API, as the error means that something wrong with request data and retry do not change anything, every next request to GitHub API respond same error.

My error was in,

tag_name: "20.0.0a1 Release"

where I wrongly supply name as tag_name. I fixed that, but will be able to use GitHub API within GitHub Actions only after my rate limit ban ends.

Thanks in advance and if you see this as reasonable, I would be glad to supply a PR to fix this.

Support a newline delimiter for asset patterns

step.with only supports string keys and values so we're currently supporting multiple asset patterns as comma delimited string. Yaml has a more readable multiline syntax. We should technically be able to support both at the same time. When we do advertise multiline in examples

File glob does not work with directories

For example I have the following.

    - name: Release
      uses: softprops/action-gh-release@v1
      if: startsWith(github.ref, 'refs/tags/')
      with:
        draft: true
        prerelease: true
        files: |
          'Keyboards/firmware/*.dfu.bin'
          'Bootloader/Builds/bootloader/*.bootloader.bin'
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The glob doesn't seem to work correctly.

πŸ‘©β€πŸ­ Creating new GitHub release for tag v0.5.7test...
πŸ€” 'Keyboards/firmware/*.dfu.bin','Bootloader/Builds/bootloader/*.bootloader.bin' not include valid file.

For now I'll get around this by scripting the build to output the files to a single directory (though this is not ideal).

Release Failed: [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated.

(node:5363) UnhandledPromiseRejectionWarning: HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"custom","field":"size","message":"size is not included in the list"}
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:5363) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5363) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

https://github.com/Loyalsoldier/v2ray-rules-dat/runs/1306027772?check_suite_focus=true

GITHUB_TOKEN is invalidated after time window causing action to fail

On Windows runners this fails with:

Run softprops/action-gh-release@v1
   with:
    files: livesplit-core-*.*
  env:
    GITHUB_TOKEN: ***
⚠️ Unexpected error fetching GitHub release for tag refs/tags/v-testing: HttpError: Bad credentials
##[error]Bad credentials
##[error]Node run failed with exit code 1

support merging draft releases

as mentioned in #11 using this action with draft releases in a build matrix with more than one matrix case results in multiple drafts. Some suggestions work arounds can be found here

Provide option to upload files synchronously, to conserve ordering

When uploading multiple files they're sent in parallel, which is great for swiftness, but they usually end up in a different order than they were declared in the files property.
In our case we're uploading files along with their checksums in separate files, and we'd like the files to be listed next to their checksums.
How about providing an option to do the upload synchronously? Thanks!

Ditch openssl dependency

Technically this shouldn't be needed when using rustls but it popped up as an issue compiling. Let's fix this for a smaller binary size

Unhandled HttpError and fail silently

See the "Release on Mac" step of the "macos-latest Qt 5.12.7" job here. It failed silently.

The log:

Run softprops/action-gh-release@v1
  with:
    draft: true
    files: build/CP_Editor-6.0.2-x64.dmg
    name: CP Editor 6.0.2
  env:
    CMAKE_VERSION: 3.16.4
    NINJA_VERSION: 1.10.0
    BUILD_TYPE: Release
    CCACHE_VERSION: 3.7.7
    pythonLocation: /Users/runner/hostedtoolcache/Python/3.7.6/x64
    Qt5_Dir: /Users/runner/runners/2.165.2/work/cp-editor/Qt/5.12.7/clang_64
    GITHUB_TOKEN: ***
πŸ‘©β€πŸ­ Creating new GitHub release for tag 6.0.2...
⬆️ Uploading CP_Editor-6.0.2-x64.dmg...
πŸŽ‰ Release ready at https://github.com/cpeditor/cp-editor/releases/tag/untagged-75575abc284ad6a2f272
(node:2738) UnhandledPromiseRejectionWarning: HttpError: Error saving asset
    at /Users/runner/runners/2.165.2/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2738) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2738) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior: this step should fail after this error.

UnhandledPromiseRejectionWarning: HttpError: Error saving asset

It looks like the file exists but the upload fails (and is not retried):

Run softprops/action-gh-release@v1
  with:
    files: amz-deno.gz
  deno-lambda-layer.zip
  deno-lambda-example.zip
  
    draft: true
  env:
    GITHUB_TOKEN: ***
⬆️ Uploading amz-deno.gz...
⬆️ Uploading deno-lambda-layer.zip...
⬆️ Uploading deno-lambda-example.zip...
πŸŽ‰ Release ready at https://github.com/hayd/deno-lambda/releases/tag/0.35.0
(node:4725) UnhandledPromiseRejectionWarning: HttpError: Error saving asset
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:4725) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4725) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is the first time I've seen this, previously it has been working.

Update marketplace listing

When you go through the process of creating a new workflow and searching for actions to use, this one is the top result for "release", but the provided snippet doesn't work:

image

It references v0.1.0, which appears to not be possible to download from Docker successfully anymore since it seems to rely on an image that has been removed. The snippet also misses important requirements that are available on the repo homepage.

The marketplace page mirrors the repo readme, but still lists the v0.1.0 version instead of the 1.0.

Cannot disable release body append mechanism when updating an existing release

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

Support release asset patching behavior to overwrite existing release assets

Hello, I've just discovered that the overwrite of already existing release assets of a existing release tag/name is not handled properly. The GitHub action just fails silent with not handled promise rejection warnings (why not errors?) and returns a success state, which is incorrect and should be failing!

The problem occurs in one of my nightly build and release GitHub workflows, which updates the same release tag/name with rebuild binaries, but the binaries are not updated at all. The following log message depicts the not handled promise rejection warning:

(node:2698) UnhandledPromiseRejectionWarning: HttpError: Validation Failed:
{"resource":"ReleaseAsset","code":"already_exists","field":"name"}
  at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2698) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). 
(rejection id: 1)

The issue and feature request is similar to #42, which describes a merging of assets, but not explicit overwrite. Maybe an option (e.g. asset) can be introduced in the GitHub action configuration to set different GitHub release patch behaviors.

  • asset: create represents the current and default behavior, but shall fail if the asset already exists
  • asset: patch represents a new behavior to overwrite only existing assets
  • asset: merge represents a new behavior to overwrite existing and add new ones as well, so a combination of create and patch, which shall cover the issue in #42 as well.

A workflow example configuration would look like:

    - name: Release
      uses: softprops/action-gh-release@v1
      with:
        files: "artifacts/**"
        asset: patch
        tag_name: nightly
        name: nightly
        draft: false
        prerelease: true
        body: |
          Nightly release
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

HttpError: API rate limit exceeded for installation

I've specified token by GITHUB_TOKEN, but I get the following error:

Unexpected error fetching GitHub release for tag refs/heads/v1.079-dev: HttpError: API rate limit exceeded for installation ID 5238618.

image

It reads the problem is during 'fetching GitHub release'. Is the action utilizes token in the right way?

release published trigger

I want to trigger another workflow when the release has been published

on:
  release:
    types: [published]

Looking at the code I am not sure, but it looks like this might cause a race condition with the file upload.

Does the release maybe have to be drafted, files uploaded and then published for this to work?
I could not find clear documentation on this.

Allow removal for old releases

Hi! I am looking to setup nightly releases for rust-analyzer, and for that I want to publish a github release every night under the same tag. IE, I want the tag itself to move. Looks like at the moment actions-gh-release silently fails in this case:


Release
1s
(node:2749) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
Run softprops/action-gh-release@v1
⬆️ Uploading rust-analyzer-linux...
⬆️ Uploading rust-analyzer-windows.exe...
⬆️ Uploading rust-analyzer-mac...
⬆️ Uploading rust-analyzer.vsix...
πŸŽ‰ Release ready at https://github.com/matklad/rust-analyzer/releases/tag/2020-03-04
(node:2749) UnhandledPromiseRejectionWarning: HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2749) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2749) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2749) UnhandledPromiseRejectionWarning: HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2749) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2749) UnhandledPromiseRejectionWarning: HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2749) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:2749) UnhandledPromiseRejectionWarning: HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2749) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

Failing by default is probably the right behavior, but it would be cool if the action had an overwrite: boolean flag to control this behavior

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.