mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-04-24 18:02:15 +00:00
add download-latest functionality to forgejo-release.sh
This commit is contained in:
parent
332006402a
commit
91bf7b3c3e
1 changed files with 5 additions and 2 deletions
|
@ -147,14 +147,17 @@ download() {
|
||||||
(
|
(
|
||||||
mkdir -p $RELEASE_DIR
|
mkdir -p $RELEASE_DIR
|
||||||
cd $RELEASE_DIR
|
cd $RELEASE_DIR
|
||||||
|
if test ${DOWNLOAD_LATEST} == "true"; then
|
||||||
|
api GET repos/$REPO/releases/latest > $TMP_DIR/assets.json
|
||||||
|
elif test ${DOWNLOAD_lATEST} == "false"; then
|
||||||
api GET repos/$REPO/releases/tags/$TAG > $TMP_DIR/assets.json
|
api GET repos/$REPO/releases/tags/$TAG > $TMP_DIR/assets.json
|
||||||
|
fi
|
||||||
jq --raw-output '.assets[] | "\(.name) \(.browser_download_url)"' < $TMP_DIR/assets.json | while read name url ; do
|
jq --raw-output '.assets[] | "\(.name) \(.browser_download_url)"' < $TMP_DIR/assets.json | while read name url ; do
|
||||||
curl --fail -H "Authorization: token $TOKEN" -o $name -L $url
|
curl --fail -H "Authorization: token $TOKEN" -o $name -L $url
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
missing() {
|
missing() {
|
||||||
echo need upload or download argument got nothing
|
echo need upload or download argument got nothing
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue