Make package publishing resilient [skip ci]

This commit is contained in:
2026-08-14 15:03:17 +08:00
parent a2ecfcf550
commit 8cde8109e9

View File

@@ -90,16 +90,6 @@ jobs:
cd dist
sha256sum ./*.tar.gz > SHA256SUMS
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: bdrclone-build-${{ github.run_number }}
path: |
dist/*.tar.gz
dist/SHA256SUMS
if-no-files-found: error
retention-days: 30
- name: Publish Gitea package
if: startsWith(github.ref, 'refs/tags/v') || inputs.publish_version != ''
shell: bash
@@ -119,6 +109,8 @@ jobs:
for package_file in dist/*.tar.gz dist/SHA256SUMS; do
curl --fail-with-body --silent --show-error \
--retry 5 --retry-all-errors --retry-delay 3 \
--connect-timeout 20 --max-time 300 \
--request PUT \
--header "Authorization: token $GITEA_TOKEN" \
--upload-file "$package_file" \
@@ -126,6 +118,19 @@ jobs:
done
curl --fail-with-body --silent --show-error \
--retry 5 --retry-all-errors --retry-delay 3 \
--connect-timeout 20 --max-time 300 \
--request POST \
--header "Authorization: token $GITEA_TOKEN" \
"$GITEA_SERVER_URL/api/v1/packages/$GITEA_OWNER/generic/bdrclone/-/link/$repository_name"
- name: Upload temporary build artifacts
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: bdrclone-build-${{ github.run_number }}
path: |
dist/*.tar.gz
dist/SHA256SUMS
if-no-files-found: error
retention-days: 30