[gtk] fix packages auth
Some checks failed
GTK RPM Release / build-gtk-rpm-release (push) Failing after 2m54s
Some checks failed
GTK RPM Release / build-gtk-rpm-release (push) Failing after 2m54s
This commit is contained in:
@@ -100,16 +100,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload RPMs to Gitea package registry
|
- name: Upload RPMs to Gitea package registry
|
||||||
env:
|
env:
|
||||||
|
GITEA_ACTOR: ${{ gitea.actor }}
|
||||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
RPM_PACKAGE_GROUP: ${{ env.RPM_PACKAGE_GROUP }}
|
RPM_PACKAGE_GROUP: ${{ env.RPM_PACKAGE_GROUP }}
|
||||||
RPM_PACKAGE_TOKEN: ${{ secrets.RPM_PACKAGE_TOKEN }}
|
RPM_PACKAGE_TOKEN: ${{ secrets.RPM_PACKAGE_TOKEN }}
|
||||||
|
RPM_PACKAGE_USERNAME: ${{ vars.RPM_PACKAGE_USERNAME }}
|
||||||
RELEASE_ASSETS_DIR: ${{ env.RELEASE_ASSETS_DIR }}
|
RELEASE_ASSETS_DIR: ${{ env.RELEASE_ASSETS_DIR }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
owner="${GITEA_REPOSITORY%%/*}"
|
owner="${GITEA_REPOSITORY%%/*}"
|
||||||
|
package_user="${RPM_PACKAGE_USERNAME:-${GITEA_ACTOR:-}}"
|
||||||
token="${RPM_PACKAGE_TOKEN:-${GITEA_TOKEN:-}}"
|
token="${RPM_PACKAGE_TOKEN:-${GITEA_TOKEN:-}}"
|
||||||
group="${RPM_PACKAGE_GROUP:-}"
|
group="${RPM_PACKAGE_GROUP:-}"
|
||||||
|
|
||||||
@@ -118,6 +121,11 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$package_user" ]; then
|
||||||
|
echo "Missing package upload username. Set RPM_PACKAGE_USERNAME or ensure gitea.actor is available." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$token" ]; then
|
if [ -z "$token" ]; then
|
||||||
echo "Missing upload token. Set RPM_PACKAGE_TOKEN or ensure secrets.GITEA_TOKEN is available." >&2
|
echo "Missing upload token. Set RPM_PACKAGE_TOKEN or ensure secrets.GITEA_TOKEN is available." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -144,7 +152,7 @@ jobs:
|
|||||||
http_code="$(curl --silent --show-error \
|
http_code="$(curl --silent --show-error \
|
||||||
--write-out '%{http_code}' \
|
--write-out '%{http_code}' \
|
||||||
--output /tmp/package-upload-response \
|
--output /tmp/package-upload-response \
|
||||||
--header "Authorization: token ${token}" \
|
--user "${package_user}:${token}" \
|
||||||
--upload-file "$rpm" \
|
--upload-file "$rpm" \
|
||||||
"$upload_url")"
|
"$upload_url")"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user