softprops / action-gh-release Goto Github PK
View Code? Open in Web Editor NEWπ¦ :octocat: GitHub Action for creating GitHub Releases
License: MIT License
π¦ :octocat: GitHub Action for creating GitHub Releases
License: MIT License
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,
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.
Getting a warning when using fail_on_unmatched_files
Warning: Unexpected input(s) 'fail_on_unmatched_files', valid inputs are ['body', 'body_path', 'name', 'tag_name', 'draft', 'prerelease', 'files']
https://github.com/visualon/jenkins-gitea-plugin/runs/2057690081?check_suite_focus=true
Hi,
I have used actions/create-release before, and it outputs upload_url to have further action uploads artifact to the release.
I do not see this kind of output here, is there any way to achieve the same behavior ?
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.
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.
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.
Here's an example run: https://github.com/matchai/test-rust-actions/runs/244631334
Suggestions:
error.status
is nully.GitHubs documentation states these can only be used on Linux virtual hosts
https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsuses
ε¦ι’οΌ
body ε body-pathε°εΊθ¦ζδΉεοΌηδΈζγζ沑ζε―η¨ηδΎεοΌ
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)."
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
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
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 }}
when I use like this
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
repository: guanpengchn/aaa
files: "dist/**"
got a warning and still use the old repo
Warning: Unexpected input(s) 'repository', valid inputs are ['body', 'body_path', 'name', 'tag_name', 'draft', 'prerelease', 'files']
Hello π
Thanks for this GitHub Actions!
I'm testing it today but I got super confused by the glob:
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.
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 existsasset: patch
represents a new behavior to overwrite only existing assetsasset: 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 }}
Is it possible to create a release via the action from my github account? Using a PAT?
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
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'
The other two are working just fine. Is action-gh-release
supported on a windows build?
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.
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.
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
Do you plan to support download of a release asset? It would be a great feature.
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
(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
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).
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!
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.
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
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.
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 }}
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.
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.
It reads the problem is during 'fetching GitHub release'. Is the action utilizes token in the right way?
This should be as easy as adding a new input
It should be possible to only give the GitHub package methods an interface instead of the GitHub client
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?
When upload a windows executable the browser and windows is blocking the file. It would be nice, if the action could provide option to compress files before upload.
I want to create a release and upload assets to other repos. Please support this feature. Thanks!
This can be admittedly confusing to users that aren't aware of GitHib releases constraints.
Let's setup some documentation and align with the way Travis deals with tag constraints for cases where users wish to tag on commit pushes https://docs.travis-ci.com/user/deployment/releases/#setting-the-tag-at-deployment-time
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?
I will likely take some trial and error to get asset path patterns right. Why not provide a useful message when a pattern doesn't resolve to an expected file
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
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:
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
GitHub actions defines a way to declare action outputs
https://help.github.com/en/articles/metadata-syntax-for-github-actions#outputs
This may be useful for the purposes of actions that comes after. Some potential outputs ideas
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:
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.
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!
I had the following error:
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).
Contrary to what is written in the readme:
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.
The actual javascript code for extracting releaseBody checks if body
is provided and ignores reading the body_path
outright.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.