ci: add automated GitHub-to-GitCode repo and release mirror sync

This commit is contained in:
Nwflower committed 2026-11-29 02:00:59 -07:00
1 parent a7921e998b
commit f85e1aba88
3 files changed
+286

No files matched your search

+19
View File
@@ -237,6 +237,25 @@ jobs:
gh release create "runtime-$c" @assets --prerelease --title "Portable Runtime runtime-$c (alpha)" --notes $notes
if ($LASTEXITCODE) { throw "gh release create failed ($LASTEXITCODE)" }
- name: Mirror alpha prerelease to GitCode (best-effort)
if: github.event_name == 'schedule' || inputs.publish
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITCODE_TOKEN: ${{ secrets.GITCODE_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
shell: pwsh
run: |
if (-not $env:GITCODE_TOKEN) {
Write-Host 'GITCODE_TOKEN not set; skipping GitCode mirror'
exit 0
}
$tag = "runtime-$($env:RELEASE_ID)"
git fetch --tags origin
$auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("Nwflower:$($env:GITCODE_TOKEN)"))
git -c "http.extraheader=Authorization: Basic $auth" push "https://gitcode.com/Nwflower/Reims-Go.git" "refs/tags/${tag}:refs/tags/${tag}"
python scripts/sync-gitcode-release.py $tag
- name: Prune old alpha prereleases
if: github.event_name == 'schedule' || inputs.publish
env: