2019-11-03 11:00:28 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script must run on a lot of different platforms.
|
|
|
|
# It assumes that the following things are installed:
|
|
|
|
# * curl
|
|
|
|
# * jq
|
2019-11-03 11:20:35 -08:00
|
|
|
# * cat
|
2019-11-03 11:00:28 -08:00
|
|
|
|
2019-11-03 11:55:09 -08:00
|
|
|
# We do not set -x because this would leak the oauth access token.
|
|
|
|
set +x
|
|
|
|
|
2019-11-03 11:00:28 -08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
OAUTH_TOKEN="$2"
|
|
|
|
YML_FILE="tmp.yml"
|
|
|
|
|
2019-11-03 11:20:35 -08:00
|
|
|
cat <<EOF >"$YML_FILE"
|
2019-12-02 07:47:49 -08:00
|
|
|
image: alpine/latest
|
2019-11-03 11:20:35 -08:00
|
|
|
packages:
|
|
|
|
- py3-pip
|
|
|
|
- curl
|
|
|
|
- jq
|
2019-12-02 07:47:49 -08:00
|
|
|
- xz
|
2019-11-03 11:20:35 -08:00
|
|
|
secrets:
|
|
|
|
- 6c60aaee-92e7-4e7d-812c-114817689b4d
|
|
|
|
sources:
|
|
|
|
- https://github.com/ziglang/zig
|
|
|
|
tasks:
|
|
|
|
- build: cd zig && ./ci/srht/update_download_page $VERSION
|
|
|
|
EOF
|
2019-11-03 11:00:28 -08:00
|
|
|
|
|
|
|
jq <$YML_FILE -sR '{
|
|
|
|
"manifest": .,
|
|
|
|
}' | curl \
|
|
|
|
-H Authorization:"token $OAUTH_TOKEN" \
|
|
|
|
-H Content-Type:application/json \
|
|
|
|
-X POST \
|
|
|
|
-d @- "https://builds.sr.ht/api/jobs"
|