File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ /releases
1
2
* .deb
2
3
archs
Original file line number Diff line number Diff line change 1
- #! /bin/bash
2
- set -e
1
+ #! /bin/bash -e
3
2
4
3
# A POSIX variable
5
4
OPTIND=1 # Reset in case getopts has been used previously in the shell.
@@ -17,6 +16,7 @@ shift $((OPTIND-1))
17
16
18
17
[ " $1 " = " --" ] && shift
19
18
19
+ rm -rf releases
20
20
mkdir releases
21
21
cp /usr/bin/qemu-* -static releases/
22
22
cd releases/
@@ -25,6 +25,7 @@ for file in *; do
25
25
cp $file .tar.gz x86_64_$file .tar.gz
26
26
done
27
27
28
+ # create a release
28
29
release_id=$( curl -sL -X POST \
29
30
-H " Content-Type: application/json" \
30
31
-H " Accept: application/vnd.github.v3+json" \
@@ -37,6 +38,15 @@ release_id=$(curl -sL -X POST \
37
38
\" draft\" : false,
38
39
\" prerelease\" : false
39
40
}" " https://api.github.com/repos/multiarch/qemu-user-static/releases" | jq -r " .id" )
41
+ if [ " $release_id " = " null" ]; then
42
+ # get the existing release id
43
+ release_id=$( set -x; curl -sL \
44
+ -H " Content-Type: application/json" \
45
+ -H " Accept: application/vnd.github.v3+json" \
46
+ -H " Authorization: token ${GITHUB_TOKEN} " \
47
+ -H " Cache-Control: no-cache" \
48
+ " https://api.github.com/repos/multiarch/qemu-user-static/releases" | jq -r --arg version " $VERSION " ' .[] | select(.name == "v"+$version).id' )
49
+ fi
40
50
41
51
for file in * ; do
42
52
content_type=$( file --mime-type -b ${file} )
You can’t perform that action at this time.
0 commit comments