| 1 | #!/bin/bash |
| 2 | |
| 3 | if [ -z "$1" ]; then |
| 4 | echo "Missing repo to upload!" |
| 5 | exit 1 |
| 6 | fi |
| 7 | |
| 8 | if [ -n "${CI_COMMIT_TAG}" ]; then |
| 9 | BUILD_URL=$(./flat-manager-client create --public_download https://flatpak.neko.dev stable) |
| 10 | elif [ "master" = "${CI_COMMIT_REF_NAME}" ]; then |
| 11 | BUILD_URL=$(./flat-manager-client create --public_download https://flatpak.neko.dev nightly) |
| 12 | fi |
| 13 | |
| 14 | if [ -z "${BUILD_URL}" ]; then |
| 15 | echo "No upload to repo." |
| 16 | exit 0 |
| 17 | fi |
| 18 | |
| 19 | BUILD_URL=${BUILD_URL/http:/https:} |
| 20 | |
| 21 | ./flat-manager-client push --commit --wait --wait-update $BUILD_URL $1 |
| 22 | ./flat-manager-client publish --wait --wait-update $BUILD_URL |
| 23 |