- ci.yml: Build on every push (for testing) - release.yml: Full release pipeline on version tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
79800c5c2a
commit
e1604ffe92
53
.gitea/workflows/ci.yml
Normal file
53
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,53 @@
|
||||
name: CI Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
QT_PATH: C:\Qt\6.10.0\msvc2022_64
|
||||
JOM_PATH: C:\Qt\Tools\QtCreator\bin\jom
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows:host
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%QT_PATH%\bin;%JOM_PATH%;%PATH%
|
||||
|
||||
if not exist build mkdir build
|
||||
cd build
|
||||
|
||||
echo === Running qmake ===
|
||||
qmake.exe ..\XPlor.pro -spec win32-msvc "CONFIG+=release"
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Building with jom ===
|
||||
jom.exe -j 1
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Build successful ===
|
||||
|
||||
- name: Test windeployqt
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%QT_PATH%\bin;%PATH%
|
||||
|
||||
cd build\app\release
|
||||
windeployqt6.exe --release --no-translations app.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === windeployqt successful ===
|
||||
213
.gitea/workflows/release.yml
Normal file
213
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,213 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]*.[0-9]*'
|
||||
|
||||
env:
|
||||
QT_PATH: C:\Qt\6.10.0\msvc2022_64
|
||||
IFW_PATH: C:\Qt\Tools\QtInstallerFramework\4.10\bin
|
||||
JOM_PATH: C:\Qt\Tools\QtCreator\bin\jom
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: windows:host
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Extract version from tag
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Build Release
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%QT_PATH%\bin;%JOM_PATH%;%PATH%
|
||||
|
||||
if not exist build\Release mkdir build\Release
|
||||
cd build\Release
|
||||
|
||||
echo === Running qmake ===
|
||||
qmake.exe ..\..\XPlor.pro -spec win32-msvc "CONFIG+=release"
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Building with jom ===
|
||||
jom.exe -j 1
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Installing ===
|
||||
jom.exe install
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Cleaning artifacts ===
|
||||
jom.exe clean
|
||||
|
||||
- name: Deploy Qt Libraries
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%QT_PATH%\bin;%PATH%
|
||||
|
||||
echo === windeployqt for app ===
|
||||
cd build\Release\app\release
|
||||
windeployqt6.exe --release --no-translations app.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
cd ..\..\..\..
|
||||
|
||||
echo === windeployqt for cli ===
|
||||
cd build\Release\tools\cli\release
|
||||
windeployqt6.exe --release --no-translations cli.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
- name: Package GUI
|
||||
shell: cmd
|
||||
run: |
|
||||
set GUI_DATA=installer\packages\com.xplor.gui\data
|
||||
if exist "%GUI_DATA%" rmdir /s /q "%GUI_DATA%"
|
||||
mkdir "%GUI_DATA%"
|
||||
|
||||
xcopy /s /e /y /q "build\Release\app\release\*" "%GUI_DATA%\" >nul
|
||||
|
||||
REM Remove definitions and scripts (separate packages)
|
||||
if exist "%GUI_DATA%\definitions" rmdir /s /q "%GUI_DATA%\definitions"
|
||||
if exist "%GUI_DATA%\scripts" rmdir /s /q "%GUI_DATA%\scripts"
|
||||
|
||||
REM Rename exe
|
||||
if exist "%GUI_DATA%\app.exe" ren "%GUI_DATA%\app.exe" "XPlor.exe"
|
||||
|
||||
echo GUI package: OK
|
||||
|
||||
- name: Package CLI
|
||||
shell: cmd
|
||||
run: |
|
||||
set CLI_DATA=installer\packages\com.xplor.cli\data
|
||||
if exist "%CLI_DATA%" rmdir /s /q "%CLI_DATA%"
|
||||
mkdir "%CLI_DATA%\cli"
|
||||
|
||||
xcopy /s /e /y /q "build\Release\tools\cli\release\*" "%CLI_DATA%\cli\" >nul
|
||||
|
||||
REM Rename exe
|
||||
if exist "%CLI_DATA%\cli\cli.exe" ren "%CLI_DATA%\cli\cli.exe" "xplor-cli.exe"
|
||||
|
||||
echo CLI package: OK
|
||||
|
||||
- name: Package Definitions
|
||||
shell: cmd
|
||||
run: |
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
for %%D in (cod volition deadrising asura fmod thqa wii) do (
|
||||
set "DEF_DATA=installer\packages\com.xplor.definitions.%%D\data"
|
||||
if exist "!DEF_DATA!" rmdir /s /q "!DEF_DATA!"
|
||||
mkdir "!DEF_DATA!\definitions\%%D" 2>nul
|
||||
|
||||
if exist "definitions\%%D" (
|
||||
xcopy /s /e /y /q "definitions\%%D\*" "!DEF_DATA!\definitions\%%D\" >nul
|
||||
echo %%D: OK
|
||||
)
|
||||
)
|
||||
|
||||
- name: Package Docs and Scripts
|
||||
shell: cmd
|
||||
run: |
|
||||
REM Documentation
|
||||
set DOCS_DATA=installer\packages\com.xplor.docs\data
|
||||
if exist "%DOCS_DATA%" rmdir /s /q "%DOCS_DATA%"
|
||||
mkdir "%DOCS_DATA%\docs"
|
||||
if exist "docs\xscript-guide.pdf" copy /y "docs\xscript-guide.pdf" "%DOCS_DATA%\docs\" >nul
|
||||
if exist "docs\xscript-guide.md" copy /y "docs\xscript-guide.md" "%DOCS_DATA%\docs\" >nul
|
||||
echo Documentation: OK
|
||||
|
||||
REM Scripts
|
||||
set SCRIPTS_DATA=installer\packages\com.xplor.scripts\data
|
||||
if exist "%SCRIPTS_DATA%" rmdir /s /q "%SCRIPTS_DATA%"
|
||||
mkdir "%SCRIPTS_DATA%\scripts"
|
||||
if exist "scripts" xcopy /s /e /y /q "scripts\*" "%SCRIPTS_DATA%\scripts\" >nul
|
||||
echo Scripts: OK
|
||||
|
||||
- name: Update Package Versions
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ env.VERSION }}"
|
||||
$today = Get-Date -Format "yyyy-MM-dd"
|
||||
$branch = "${{ github.ref_name }}"
|
||||
|
||||
# Update all package.xml files
|
||||
Get-ChildItem -Path "installer\packages\*\meta\package.xml" | ForEach-Object {
|
||||
$content = Get-Content $_.FullName -Raw
|
||||
$content = $content -replace '<Version>.*</Version>', "<Version>$version</Version>"
|
||||
$content = $content -replace '<ReleaseDate>.*</ReleaseDate>', "<ReleaseDate>$today</ReleaseDate>"
|
||||
Set-Content $_.FullName $content
|
||||
Write-Host "Updated: $($_.FullName)"
|
||||
}
|
||||
|
||||
# Update config.xml
|
||||
$configPath = "installer\config\config.xml"
|
||||
$content = Get-Content $configPath -Raw
|
||||
$content = $content -replace '<Version>.*</Version>', "<Version>$version</Version>"
|
||||
|
||||
# Set repository URL based on branch (main -> stable)
|
||||
$repoPath = if ($branch -eq "main") { "stable" } else { $branch }
|
||||
$content = $content -replace 'repository/[^<"]+', "repository/$repoPath"
|
||||
Set-Content $configPath $content
|
||||
Write-Host "Updated config.xml for version $version, repo path: $repoPath"
|
||||
|
||||
- name: Generate Repository
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%IFW_PATH%;%PATH%
|
||||
|
||||
if exist repository rmdir /s /q repository
|
||||
mkdir repository
|
||||
|
||||
repogen.exe --update-new-components -p installer\packages repository
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo Repository generated successfully
|
||||
|
||||
- name: Create Offline Installer
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%IFW_PATH%;%PATH%
|
||||
|
||||
binarycreator.exe --offline-only -c installer\config\config.xml -p installer\packages XPlor-%VERSION%-Setup.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo Installer created: XPlor-%VERSION%-Setup.exe
|
||||
|
||||
- name: Deploy Repository via SSH
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
key: ${{ secrets.DEPLOY_KEY }}
|
||||
source: "repository/*"
|
||||
target: ${{ secrets.DEPLOY_PATH }}/${{ github.ref_name == 'refs/heads/main' && 'stable' || 'stable' }}
|
||||
strip_components: 1
|
||||
rm: true
|
||||
|
||||
- name: Upload Installer Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: XPlor-${{ env.VERSION }}-Setup
|
||||
path: XPlor-*-Setup.exe
|
||||
retention-days: 90
|
||||
|
||||
- name: Create Gitea Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: XPlor-*-Setup.exe
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
x
Reference in New Issue
Block a user