meedamian / github-release Goto Github PK
View Code? Open in Web Editor NEWGithub Action to create, update, or add files to Github Releases
License: MIT License
Github Action to create, update, or add files to Github Releases
License: MIT License
Updating the release fails when asset is beeing updated:
- uses: meeDamian/[email protected]
with:
token: ${{github.token}}
commitish: ${{github.sha}}
tag: latest
name: Latest draft
prerelease: true
gzip: false
files: >
file.pdf:paper/paper.pdf
allow_override: true
ERR: Uploading file.pdf to Github release has failed
{
"message": "Validation Failed",
"request_id": "07C0:5BBF:F7389:15503D:5D7E3EF4",
"documentation_url": "https://developer.github.com/v3",
"errors": [
{
"resource": "ReleaseAsset",
"code": "already_exists",
"field": "name"
}
]
}
After manually removing the asset it seems that tag
and commitsh
was also not updated.
I have no idea why but I get frequent-but-intermittent SSL failures like following:
Create Release
Upload Assets
Files to be uploaded to Github:
devserver.js
curl: (55) OpenSSL SSL_write: Connection reset by peer, errno 104
Currently supports body
parameter that takes starting. It would be helpful if there is another parameter body_path
that takes file (txt or md) and puts in body
Hi!
Thanks for the project, really appreciate it.
Just wondering if globs work in files? for example will the following:
jobs:
build:
...
steps:
...
- uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
gzip: false
allow_override: true
files: build/*.txt
expand to upload every *.txt
file under the build/
directory individually?
I've tried look through the source code, but my bash isn't as good as I thought. There's one comment that implies globbing does happen, but some small tests just in my shell make it seem like they don't work.
I think the following is the same as the source, but it doesn't glob, and echos calendars/*.ics
glob=build/*.txt
for filename in "$glob"; do
echo $filename
done
However this example (which isn't the same) globs as expected:
for filename in build/*.txt; do
echo $filename
done
If you can confirm what exactly the expected behaviour is, I'm happy to make a PR to add this feature!
Thanks!
Hi Damian,
Great work extending the github-release action.
I would like to make a suggestion regarding handling folders.
gzip: true
files: >
VxFormGenerator.Components.Plain:VxFormGenerator.Components.Plain/bin/Release/
VxFormGenerator.Core:VxFormGenerator.Core/bin/Release/
VxFormGenerator.Components.Bootstrap:VxFormGenerator.Components.Bootstrap/bin/Release/
This will result in a .tgz
file. containing: VxFormGenerator.Core.tgz\VxFormGenerator.Core.tar\VxFormGenerator.Core\bin\Release\*.*
Why not add an extra option flatZip
that does the following: zip the content found in the folder: VxFormGenerator.Core\bin\Release\
.
This would result in a VxFormGenerator.Core.zip
containing only the data found at the Release
folder.
How does this sound to you?
Hi,
Neovim uses github-release to create nightly releases:
https://github.com/neovim/neovim/actions/runs/1247880534/workflow#L203-L224
However, it looks like the action fails from time to time with the following error message:
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
}
curl: (56) OpenSSL SSL_read: Connection reset by peer
As far as I understand, this means that github-release is failing to delete assets of a previous release, here:
Lines 217 to 225 in 7ae1949
This is very odd, as Neovim already takes care of deleting its previous release:
https://github.com/neovim/neovim/actions/runs/1247880534/workflow#L164-L170
So I assume there must be some latency on Github's side that causes github-release to see the previous release (even though it should be deleted) and fail while trying to delete its contents.
If my analysis is right, I think a solution to this problem could be to ignore failure to delete the previous release's artifacts. Does that sound correct to you? If yes, do you want a PR?
I have a separate workflow with the following trigger:
on:
release:
types: [created, edited]
It does not trigger after running the workflow with your action, even when the release is created properly.
Make this Action's API identical to https://github.com/actions/create-release, except extended with files:
option.
Should prolly also capture values from previous inputs (ex. tag="${INPUT_TAG_NAME:-$INPUT_TAG}"
)
hit the brick wall, getting the error below
##[error]Container action is only supported on Linux
You may use https://github.com/cilerler/test-github-actions2 as a scratchpad.
Minor issue, but I'm using the body
input (along with files
, etc.) to upload a markdown formatted changelog. After Github Actions expands the output from a previous step, jq
rejects the input because it tries to parse the string. It would be nice if this entire body was treated as a string literal for such purposes.
Example:
body: '# Change Log ## [0.4.2](https://github.com/ksync/ksync/tree/0.4.2) (2019-12-06) [Full Changelog](https://github.com/ksync/ksync/compare/0.4.1...0.4.2) **Closed issues:** - Images for release 0.4.0 missing on dockerhub [\#323](https://github.com/ksync/ksync/issues/323) - Ksync copy should copy with default container user [\#296](https://github.com/ksync/ksync/issues/296) **Merged pull requests:** - Switch to using a custom generated changelog [\#328](https://github.com/ksync/ksync/pull/328) ([timfallmk](https://github.com/timfallmk)) - Reformat tags to show version properly. [\#326](https://github.com/ksync/ksync/pull/326) ([timfallmk](https://github.com/timfallmk)) - Syncthing update [\#321](https://github.com/ksync/ksync/pull/321) ([timfallmk](https://github.com/timfallmk)) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*'
files: bin/ksync_darwin_amd64 bin/ksync_linux_amd64 bin/ksync_windows_amd64.exe bin/radar_darwin_amd64 bin/radar_linux_amd64 bin/radar_windows_amd64.exe
allow_override: false
env:
GOROOT: /opt/hostedtoolcache/go/1.13.4/x64
/usr/bin/docker run --name af96b4d7ee21502ef4470890e9e162a481d4cc_4725ca --label af96b4 --workdir /github/workspace --rm -e GOROOT -e INPUT_TOKEN -e INPUT_GZIP -e INPUT_BODY -e INPUT_FILES -e INPUT_TAG -e INPUT_COMMITISH -e INPUT_NAME -e INPUT_DRAFT -e INPUT_PRERELEASE -e INPUT_ALLOW_OVERRIDE -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/ksync/ksync":"/github/workspace" af96b4:d7ee21502ef4470890e9e162a481d4cc
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 129 100 129 0 0 1000 0 --:--:-- --:--:-- --:--:-- 1000
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs at https://stedolan.github.io/jq
ERR: POST to Github release has failed
{
"message": "Invalid request.\n\nFor 'links/0/schema', nil is not an object.",
"documentation_url": "https://developer.github.com/v3/repos/releases/#create-a-release"
}
##[error]Docker run failed with exit code 1
Complete job
Relevant section of workflow yaml:
- name: Upload assets to release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
gzip: false
body: '${{ steps.changelog.outputs.CHANGELOG }}'
files: >
bin/ksync_darwin_amd64
bin/ksync_linux_amd64
bin/ksync_windows_amd64.exe
bin/radar_darwin_amd64
bin/radar_linux_amd64
bin/radar_windows_amd64.exe
I would like to be able to use buildNumber
environment variable in my asset name
files: >
artifacts-${buildNumber}:./artifacts/ArtifactStagingDirectory
or alternatively, allow using TAG (which will be same as buildNumber in my case)
files: >
artifacts-${TAG}:./artifacts/ArtifactStagingDirectory
The https://docs.github.com/en/rest/reference/repos#get-a-release-by-tag-name API seems to always return 404 for a draft release. So that makes it impossible to use this action to update a draft release (e.g. publish it).
2020-12-08T12:13:56.9429791Z ##[group]Run meeDamian/[email protected]
2020-12-08T12:13:56.9430318Z with:
2020-12-08T12:13:56.9430638Z tag: continuous
2020-12-08T12:13:56.9431039Z name: Continuous release
2020-12-08T12:13:56.9431726Z body: Continuous build for development and test
2020-12-08T12:13:56.9432185Z allow_override: true
2020-12-08T12:13:56.9433792Z token: ***
2020-12-08T12:13:56.9434105Z files: deploy
2020-12-08T12:13:56.9434410Z gzip: true
2020-12-08T12:13:56.9434672Z env:
2020-12-08T12:13:56.9435139Z pythonLocation: C:\hostedtoolcache\windows\Python\3.9.0\x64
2020-12-08T12:13:56.9435718Z Qt5_Dir: D:/a/ping-components/Qt/5.15.1/msvc2019_64
2020-12-08T12:13:56.9436292Z QT_PLUGIN_PATH: D:/a/ping-components/Qt/5.15.1/msvc2019_64/plugins
2020-12-08T12:13:56.9436888Z QML2_IMPORT_PATH: D:/a/ping-components/Qt/5.15.1/msvc2019_64/qml
2020-12-08T12:13:56.9437355Z ##[endgroup]
2020-12-08T12:13:56.9582820Z ##[error]Container action is only supported on Linux
Hello, I have a following problem with creating and overriding the releases. When setting
draft: true
allow_override: true
then the last draft was overridden by the new draft. now this behavior is gone. you can check this action
https://github.com/agorapulse/agorapulse-oss/blob/master/.github/workflows/drafter.yml
and there releases
Instead of using the Branch name, using the Workflow name as default name would be more useful
RELEASE_NAME="${INPUT_NAME}"
if [ -z "${RELEASE_NAME}" ]; then
RELEASE_NAME="${GITHUB_WORKFLOW}"
fi
--argjson name "$(toJsonOrNull "${RELEASE_NAME}")" \
We create a bunch of releases (temp dev versions) of our open source software, OpenRefine.
See for example: https://github.com/OpenRefine/OpenRefine-nightly-releases/releases
It would be nice to use your action with a new parameter where I specify keep:3
to keep the 3 latest releases and it then deletes all the older releases.
Any chance you could add that option?
Or a brand new action called delete-older-releases
?
I looked around and didn't find something that would work. But pointers welcome.
Spaces in file names cases upload step to not work.
Config like this
- name: Release files - Ubuntu
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
gzip: false
files: >
dist_electron/*.AppImage
dist_electron/*.snap
dist_electron/latest*.yml
With files like this
total 261284
-rwxr-xr-x 1 runner docker 144196185 Mar 22 15:10 Product Name-2022.2.22.AppImage
-rw-r--r-- 1 runner docker 785 Mar 22 15:11 builder-debug.yml
-rw-r--r-- 1 runner docker 388 Mar 22 15:11 latest-linux.yml
drwxr-xr-x 5 runner docker 4096 Mar 22 15:09 linux-unpacked
-rw-r--r-- 1 runner docker 123338752 Mar 22 15:11 template-electron-vuex-vuetify_2022.2.22_amd64.snap
Generate error like this
Upload Assets
tar: dist_electron/Product: No such file or directory
tar: error exit delayed from previous errors
I am using the same action for different files. In order to not repeat myself too much, I use environmental variables. Hoever it seems that we can no use env variables in the files section.
env:
FILE: data/.test.csv
...
- uses: meeDamian/[email protected]
name: upload file
with:
token: ${{ secrets.GITHUB_TOKEN }}
allow_override: true
files: ${{ env.FILE }}
gzip: false
tag: 0.0.1
results in:
Files to be uploaded to Github:
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
}
stat: can't stat '/github/home/assets/*': No such file or directory
curl: Can't open '/github/home/assets/*'!
curl: try 'curl --help' or 'curl --manual' for more information
curl: (26) Failed to open/read local data from file/application
Same issue as #2
- name: Upload assets to release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: latest
name: latest
allow_override: true
gzip: false
files: >
filename1.ext
filename2.ext
Create Release
Upload Assets
Files to be uploaded to Github:
filename1.ext
filename2.ext
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
}
Error: failed to upload asset: filename1.ext (see log for details)
ERR: Failed asset upload: filename1.ext
{
"message": "Validation Failed",
"request_id": "07C0:4CCE:385984:52E5BB:6120476B",
"documentation_url": "https://docs.github.com/rest",
"errors": [
{
"resource": "ReleaseAsset",
"code": "already_exists",
"field": "name"
}
]
}
I also tried with uses: meeDamian/[email protected]
; however that fails to find the version.
Error: Unable to resolve action `meeDamian/[email protected]`, unable to find version `2.0.3`
I have windows and macOS specific builds and this action only support linux
Can you introduce cross platform support?
I want to provide a tag number via environment variable set in earlier steps; however, it treats it as a string.
tag: $buildNumber
then I came up with the workaround below
tag: buildNumber
(I'm sorry, my shell scripting is not good enough, so I came up with something like this in here)
if [ ! -z "${TAG}" ]; then
if TAGFROMENVVAR=$(printenv ${TAG}); then
if [ ! -z "$TAGFROMENVVAR" ]; then
TAG="${TAGFROMENVVAR}"
fi
fi
fi
it checks if the given name exists in an environment variable or not.
Like #10 (comment), probably need to replace "
with \"
. The sed
filter could probably be moved inline to toJsonOrNull
to make sure it covers other fields (really just release name).
I know this action is semi-deprecated but I am also stuck on this until the GitHub provided one handles some of the same use cases as your fantastic action.
I'll try to open a PR to fix this but I've worked around it on my end already so unless it comes up again, I may forget, so I thought I'd document it in an issue for the time being.
I don't know how to describe it so... Action file
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.