CI: Add pending SQL promotion workflow

This commit is contained in:
AlterEgo 2026-07-05 16:53:43 -05:00
parent 9da7edb982
commit 0196f74a2d
2 changed files with 52 additions and 2 deletions

View file

@ -0,0 +1,49 @@
name: promote-pending-sql
on:
workflow_dispatch:
push:
paths:
- 'sql/pending_updates/*.sql'
- 'sql/pending_updates/**/*.sql'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
promote:
if: github.actor != 'github-actions[bot]'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Promote pending SQL updates
shell: pwsh
run: ./tools/dev/promote_pending_updates.ps1 -Apply
- name: Commit promoted SQL updates
shell: pwsh
run: |
git add -A sql/pending_updates sql/updates
$changes = git status --porcelain
$status = $changes -join "`n"
Write-Host $status
if ([string]::IsNullOrWhiteSpace($status)) {
Write-Host "No promoted SQL changes to commit."
exit 0
}
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "SQL: Promote pending updates"
git push origin HEAD:${{ github.ref_name }}

View file

@ -19,7 +19,8 @@ database setup and update tracking system can apply it.
1. Add the test SQL file to the matching pending folder.
2. Apply it manually to a test database.
3. Verify server startup, affected commands, and any in-game behavior.
4. Rename or adjust the file for the mainstream update sequence.
5. Move the verified file into `sql/updates/<database>`.
4. Name the file like `YYYY-MM-DD_<database>_00_description.sql`.
5. Push the pending SQL file and let the promotion workflow move it into
`sql/updates/<database>`.
6. Let the database setup system record it through `skyfire_db_updates` and
`db_update`.