chore: publish offline npm caches as a Gitea package
Artifact upload stays at zero percent, so the cache archive uses the package API. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -150,28 +150,19 @@ jobs:
|
||||
mkdir -p artifact
|
||||
cp "$RUNNER_TEMP/offline-deps.tar.gz" "$RUNNER_TEMP/offline-deps.tar.gz.sha256" artifact/
|
||||
|
||||
- name: Upload archive
|
||||
id: artifact
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: offline-deps
|
||||
path: artifact/
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload generic package
|
||||
if: steps.artifact.outcome != 'success'
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
curl --fail-with-body --silent --show-error \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
--upload-file artifact/offline-deps.tar.gz \
|
||||
"${GITHUB_API_URL}/packages/gold_land/generic/gold-land-offline-deps/${GITHUB_RUN_ID}/offline-deps.tar.gz"
|
||||
curl --fail-with-body --silent --show-error \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
--upload-file artifact/offline-deps.tar.gz.sha256 \
|
||||
"${GITHUB_API_URL}/packages/gold_land/generic/gold-land-offline-deps/${GITHUB_RUN_ID}/offline-deps.tar.gz.sha256"
|
||||
echo "generic package uploaded for run ${GITHUB_RUN_ID}"
|
||||
upload() {
|
||||
curl --fail --silent --show-error \
|
||||
--retry 2 --retry-delay 5 --max-time 300 \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
--upload-file "$1" \
|
||||
"${GITHUB_SERVER_URL}/api/packages/gold_land/generic/gold-land-offline-deps/${GITHUB_RUN_ID}/$(basename "$1")"
|
||||
}
|
||||
upload artifact/offline-deps.tar.gz
|
||||
upload artifact/offline-deps.tar.gz.sha256
|
||||
echo "package version ${GITHUB_RUN_ID}"
|
||||
|
||||
Reference in New Issue
Block a user