mirror of
https://github.com/ProjectSkyfire/SkyFire_548
synced 2026-08-18 06:32:13 -04:00
CI: Add pending SQL promotion workflow
This commit is contained in:
parent
9da7edb982
commit
0196f74a2d
2 changed files with 52 additions and 2 deletions
49
.github/workflows/promote-pending-sql.yml
vendored
Normal file
49
.github/workflows/promote-pending-sql.yml
vendored
Normal 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 }}
|
||||
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue