This commit is contained in:
1 parent
19567aa273
commit
66fcd69d40
2 files changed
+10
-8
No files matched your search
@@ -21,5 +21,7 @@ jobs:
|
|||||||
- name: Publish package
|
- name: Publish package
|
||||||
working-directory: debian-package
|
working-directory: debian-package
|
||||||
env:
|
env:
|
||||||
GITEA_PACKAGES_TOKEN: ${{ secrets.CI_TOKEN }}
|
SERVER_URL: ${{ secrets.CI_URL }}
|
||||||
|
OWNER: ${{ secrets.CI_OWNER }}
|
||||||
|
PACKAGES_TOKEN: ${{ secrets.CI_TOKEN }}
|
||||||
run: ./publish.sh
|
run: ./publish.sh
|
||||||
@@ -8,9 +8,9 @@ case "$(uname -s)" in
|
|||||||
*) printf 'ERROR: unsupported platform %s\n' "$(uname -s)" >&2; exit 1 ;;
|
*) printf 'ERROR: unsupported platform %s\n' "$(uname -s)" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
OWNER=slawek
|
OWNER="${OWNER:-slawek}"
|
||||||
GITEA_URL=https://gitea.koszewscy.waw.pl
|
SERVER_URL="${SERVER_URL:-https://gitea.koszewscy.waw.pl}"
|
||||||
GITEA_PACKAGES_TOKEN="${GITEA_PACKAGES_TOKEN:-$(cat ~/.gitea-packages-token)}"
|
PACKAGES_TOKEN="${PACKAGES_TOKEN:-$(cat ~/.gitea-packages-token)}"
|
||||||
|
|
||||||
# Reads the changelog copied into the builder image, so no bind mount is needed.
|
# Reads the changelog copied into the builder image, so no bind mount is needed.
|
||||||
changelog_field() {
|
changelog_field() {
|
||||||
@@ -27,14 +27,14 @@ if [ ! -f "$DEB" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STATUS="$(curl -s -o /dev/null -w '%{http_code}' --user "$OWNER:$GITEA_PACKAGES_TOKEN" \
|
STATUS="$(curl -s -o /dev/null -w '%{http_code}' --user "$OWNER:$PACKAGES_TOKEN" \
|
||||||
"$GITEA_URL/api/v1/packages/$OWNER/debian/$PACKAGE/$VERSION")"
|
"$SERVER_URL/api/v1/packages/$OWNER/debian/$PACKAGE/$VERSION")"
|
||||||
case "$STATUS" in
|
case "$STATUS" in
|
||||||
200) printf '%s %s is already published, skipping.\n' "$PACKAGE" "$VERSION"; exit 0 ;;
|
200) printf '%s %s is already published, skipping.\n' "$PACKAGE" "$VERSION"; exit 0 ;;
|
||||||
404) ;;
|
404) ;;
|
||||||
*) printf 'ERROR: version check returned HTTP %s.\n' "$STATUS" >&2; exit 1 ;;
|
*) printf 'ERROR: version check returned HTTP %s.\n' "$STATUS" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
curl --fail-with-body --user "$OWNER:$GITEA_PACKAGES_TOKEN" \
|
curl --fail-with-body --user "$OWNER:$PACKAGES_TOKEN" \
|
||||||
--upload-file "$DEB" \
|
--upload-file "$DEB" \
|
||||||
"$GITEA_URL/api/packages/$OWNER/debian/pool/noble/main/upload"
|
"$SERVER_URL/api/packages/$OWNER/debian/pool/noble/main/upload"
|
||||||
Reference in new issue
Block a user