mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:09:41 +00:00
fix release sync
This commit is contained in:
8
.github/workflows/release-mirror.yml
vendored
8
.github/workflows/release-mirror.yml
vendored
@@ -145,16 +145,22 @@ jobs:
|
|||||||
notes=$(jq -r '.body // ""' release.json)
|
notes=$(jq -r '.body // ""' release.json)
|
||||||
payload=$(jq -n --arg tag "$TAG" --arg title "$title" --arg notes "$notes" \
|
payload=$(jq -n --arg tag "$TAG" --arg title "$title" --arg notes "$notes" \
|
||||||
'{tag:$tag,title:$title,release_notes:$notes,publish:true}')
|
'{tag:$tag,title:$title,release_notes:$notes,publish:true}')
|
||||||
|
|
||||||
|
# Force update release + attach all assets
|
||||||
curl -fsSL -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
|
curl -fsSL -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
|
||||||
-H 'Content-Type: application/json' --data "$payload" \
|
-H 'Content-Type: application/json' --data "$payload" \
|
||||||
"https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}/releases" || \
|
"https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}/releases" || \
|
||||||
echo 'SourceCraft release already exists; continuing with assets.'
|
curl -fsSL -X PUT -H "Authorization: Bearer $SOURCECRAFT_PAT" \
|
||||||
|
-H 'Content-Type: application/json' --data "$payload" \
|
||||||
|
"https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}/releases/${TAG}"
|
||||||
|
|
||||||
for file in assets/*; do
|
for file in assets/*; do
|
||||||
[ -f "$file" ] || continue
|
[ -f "$file" ] || continue
|
||||||
curl -fsSL -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
|
curl -fsSL -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
|
||||||
-F "name=$(basename "$file")" -F "file=@$file" \
|
-F "name=$(basename "$file")" -F "file=@$file" \
|
||||||
"https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}/releases/tag/${TAG}/attachments" || true
|
"https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}/releases/tag/${TAG}/attachments" || true
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "sourcecraft=ok" >> "$GITHUB_OUTPUT"
|
echo "sourcecraft=ok" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Sync release to GitLab
|
- name: Sync release to GitLab
|
||||||
|
|||||||
Reference in New Issue
Block a user