21 lines
1.4 KiB
YAML
21 lines
1.4 KiB
YAML
name: probe
|
|
on: push
|
|
jobs:
|
|
probe:
|
|
runs-on: fedora
|
|
steps:
|
|
- run: |
|
|
A=https://git.plabble.org/api/v1/repos/${{ github.repository }}
|
|
H="Authorization: token ${{ github.token }}"
|
|
curl -s -w " create:%{http_code}\n" -H "$H" -H 'Content-Type: application/json' -X POST $A/releases -d '{"tag_name":"latest","target_commitish":"main","name":"latest"}' | tail -c 300
|
|
id=$(curl -s -H "$H" $A/releases/tags/latest | sed 's/^{"id":\([0-9]*\).*/\1/')
|
|
echo "release id $id"
|
|
head -c 20M /dev/urandom > big.bin; echo hello > t.txt
|
|
curl -s -o /dev/null -w "upload small:%{http_code}\n" -H "$H" -F attachment=@t.txt "$A/releases/$id/assets?name=t.txt"
|
|
curl -s -o /dev/null -w "upload 20M:%{http_code}\n" -H "$H" -F attachment=@big.bin "$A/releases/$id/assets?name=big.bin"
|
|
curl -s -H "$H" $A/releases/$id/assets | head -c 400; echo
|
|
curl -s -o /dev/null -w "download anon:%{http_code}\n" -L https://git.plabble.org/${{ github.repository }}/releases/download/latest/t.txt
|
|
curl -s -o /dev/null -w "download token:%{http_code}\n" -L -H "$H" https://git.plabble.org/${{ github.repository }}/releases/download/latest/t.txt
|
|
aid=$(curl -s -H "$H" $A/releases/$id/assets | grep -o '"id":[0-9]*,"name":"t.txt"' | grep -o '[0-9]*' | head -1)
|
|
curl -s -o /dev/null -w "delete asset:%{http_code}\n" -H "$H" -X DELETE $A/releases/$id/assets/$aid
|