Aktualisiere Authentifizierungsmethode und erweitere TOKEN-Definition in CI/CD-Workflows

This commit is contained in:
2026-08-23 17:32:09 +02:00
parent 8595977d90
commit e3e12afa0d
2 changed files with 12 additions and 10 deletions
+6 -5
View File
@@ -51,13 +51,14 @@ jobs:
env: env:
GITEA_URL: ${{ gitea.server_url || github.server_url }} GITEA_URL: ${{ gitea.server_url || github.server_url }}
REPO_OWNER: ${{ gitea.repository_owner || github.repository_owner }} REPO_OWNER: ${{ gitea.repository_owner || github.repository_owner }}
TOKEN: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }} ACTOR: ${{ gitea.actor || github.actor }}
TOKEN: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }}
run: | run: |
echo "Veröffentliche Debian-Paket (Distribution: testing, Component: main)..." echo "Veröffentliche Debian-Paket (Distribution: testing, Component: main)..."
for deb in target/debian/*.deb; do for deb in target/debian/*.deb; do
[ -f "$deb" ] || continue [ -f "$deb" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$deb" \ --upload-file "$deb" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/debian/pool/testing/main/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/debian/pool/testing/main/upload"
done done
@@ -66,7 +67,7 @@ jobs:
for rpm in target/generate-rpm/*.rpm; do for rpm in target/generate-rpm/*.rpm; do
[ -f "$rpm" ] || continue [ -f "$rpm" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$rpm" \ --upload-file "$rpm" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/rpm/testing/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/rpm/testing/upload"
done done
@@ -75,7 +76,7 @@ jobs:
for pkg in target/arch/*.pkg.tar.zst; do for pkg in target/arch/*.pkg.tar.zst; do
[ -f "$pkg" ] || continue [ -f "$pkg" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$pkg" \ --upload-file "$pkg" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/arch/testing/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/arch/testing/upload"
done done
@@ -84,7 +85,7 @@ jobs:
env: env:
GITEA_URL: ${{ gitea.server_url || github.server_url }} GITEA_URL: ${{ gitea.server_url || github.server_url }}
REPO: ${{ gitea.repository || github.repository }} REPO: ${{ gitea.repository || github.repository }}
TOKEN: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }} TOKEN: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }}
run: | run: |
VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)"
TAG_NAME="v${VERSION}-preview" TAG_NAME="v${VERSION}-preview"
+6 -5
View File
@@ -51,13 +51,14 @@ jobs:
env: env:
GITEA_URL: ${{ gitea.server_url || github.server_url }} GITEA_URL: ${{ gitea.server_url || github.server_url }}
REPO_OWNER: ${{ gitea.repository_owner || github.repository_owner }} REPO_OWNER: ${{ gitea.repository_owner || github.repository_owner }}
TOKEN: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }} ACTOR: ${{ gitea.actor || github.actor }}
TOKEN: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }}
run: | run: |
echo "Veröffentliche Debian-Paket (Distribution: stable, Component: main)..." echo "Veröffentliche Debian-Paket (Distribution: stable, Component: main)..."
for deb in target/debian/*.deb; do for deb in target/debian/*.deb; do
[ -f "$deb" ] || continue [ -f "$deb" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$deb" \ --upload-file "$deb" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/debian/pool/stable/main/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/debian/pool/stable/main/upload"
done done
@@ -66,7 +67,7 @@ jobs:
for rpm in target/generate-rpm/*.rpm; do for rpm in target/generate-rpm/*.rpm; do
[ -f "$rpm" ] || continue [ -f "$rpm" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$rpm" \ --upload-file "$rpm" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/rpm/stable/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/rpm/stable/upload"
done done
@@ -75,7 +76,7 @@ jobs:
for pkg in target/arch/*.pkg.tar.zst; do for pkg in target/arch/*.pkg.tar.zst; do
[ -f "$pkg" ] || continue [ -f "$pkg" ] || continue
curl -f -s -S -X PUT \ curl -f -s -S -X PUT \
-H "Authorization: token ${TOKEN}" \ --user "${ACTOR}:${TOKEN}" \
--upload-file "$pkg" \ --upload-file "$pkg" \
"${GITEA_URL}/api/packages/${REPO_OWNER}/arch/stable/upload" "${GITEA_URL}/api/packages/${REPO_OWNER}/arch/stable/upload"
done done
@@ -84,7 +85,7 @@ jobs:
env: env:
GITEA_URL: ${{ gitea.server_url || github.server_url }} GITEA_URL: ${{ gitea.server_url || github.server_url }}
REPO: ${{ gitea.repository || github.repository }} REPO: ${{ gitea.repository || github.repository }}
TOKEN: ${{ secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }} TOKEN: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }}
run: | run: |
VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)"
TAG_NAME="v${VERSION}" TAG_NAME="v${VERSION}"