feat: add automated repository mirroring workflows and update docs

- Add GitHub Actions workflows for code and release mirroring
- Remove manual sync-releases-to-gitlab.py script
- Update .gitignore to track .github/ directory
- Document repository mirrors and VS Code extension recommendations
This commit is contained in:
2026-08-12 17:58:30 +08:00
parent b0e426c189
commit 05e49838f7
6 changed files with 256 additions and 193 deletions

37
.github/workflows/code-mirror.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Mirror source code to GitVerse
on:
push:
branches:
- '**'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: code-mirror-${{ github.ref }}
cancel-in-progress: true
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Mirror all branches
env:
GITVERSE_PAT: ${{ secrets.GITVERSE_PAT }}
GITVERSE_ORG: ${{ vars.GITVERSE_ORG || 'dcr_labs' }}
GITVERSE_REPO: ${{ vars.GITVERSE_REPO || 'dcr' }}
run: |
set -euo pipefail
test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; }
remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git"
git remote add gitverse "$remote"
# Populate local refs first, so a manual run mirrors every branch too.
git fetch origin '+refs/heads/*:refs/heads/*'
git push --prune --force gitverse 'refs/heads/*:refs/heads/*'