feat: add Gitea workflow that builds package on tag push.
Release / release (push) Failing after 1m11s
Release / release (push) Failing after 1m11s
This commit is contained in:
1 parent
656e1733d5
commit
19567aa273
3 files changed
+44
-5
No files matched your search
@@ -8,9 +8,14 @@ case "$(uname -s)" in
|
||||
*) printf 'ERROR: unsupported platform %s\n' "$(uname -s)" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
OWNER=slawek
|
||||
GITEA_URL=https://gitea.koszewscy.waw.pl
|
||||
GITEA_PACKAGES_TOKEN="${GITEA_PACKAGES_TOKEN:-$(cat ~/.gitea-packages-token)}"
|
||||
|
||||
# Reads the changelog copied into the builder image, so no bind mount is needed.
|
||||
changelog_field() {
|
||||
$CONTAINER_RUNTIME run --rm -v "$(pwd):/mnt" vpn-router-builder \
|
||||
dpkg-parsechangelog --show-field "$1" -l /mnt/debian/changelog
|
||||
$CONTAINER_RUNTIME run --rm vpn-router-builder \
|
||||
dpkg-parsechangelog --show-field "$1" -l /build/src/debian/changelog
|
||||
}
|
||||
|
||||
VERSION="$(changelog_field Version)"
|
||||
@@ -22,6 +27,14 @@ if [ ! -f "$DEB" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -v --user "slawek:$(cat ~/.gitea-packages-token)" \
|
||||
STATUS="$(curl -s -o /dev/null -w '%{http_code}' --user "$OWNER:$GITEA_PACKAGES_TOKEN" \
|
||||
"$GITEA_URL/api/v1/packages/$OWNER/debian/$PACKAGE/$VERSION")"
|
||||
case "$STATUS" in
|
||||
200) printf '%s %s is already published, skipping.\n' "$PACKAGE" "$VERSION"; exit 0 ;;
|
||||
404) ;;
|
||||
*) printf 'ERROR: version check returned HTTP %s.\n' "$STATUS" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
curl --fail-with-body --user "$OWNER:$GITEA_PACKAGES_TOKEN" \
|
||||
--upload-file "$DEB" \
|
||||
"https://gitea.koszewscy.waw.pl/api/packages/slawek/debian/pool/noble/main/upload"
|
||||
"$GITEA_URL/api/packages/$OWNER/debian/pool/noble/main/upload"
|
||||
Reference in new issue
Block a user