Skip to content

Commit 312c00d

Browse files
committed
sc: add script compilation step to ci
1 parent 925d69f commit 312c00d

8 files changed

Lines changed: 78 additions & 1 deletion

File tree

.github/workflows/all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
uses: ./.github/workflows/build_all
3030
with:
3131
project: ${{ inputs.project }}
32+
sccompile_password: ${{ secrets.SCCOMPILE_PASSWORD }}
3233

3334
- name: GTA SA The Definitive Edition Fusion Mod
3435
uses: ./.github/workflows/release_tag

.github/workflows/build_all/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
project:
55
description: "Project name"
66
required: false
7+
sccompile_password:
8+
description: "SC Compile Password"
9+
required: false
710

811
runs:
912
using: "composite"
@@ -18,6 +21,8 @@ runs:
1821
shell: cmd
1922
run: |
2023
./before_build.bat
24+
env:
25+
SCCOMPILE_PASSWORD: ${{ inputs.sccompile_password }}
2126
- name: Build
2227
shell: cmd
2328
run: |
@@ -35,4 +40,4 @@ runs:
3540
uses: actions/upload-artifact@v4
3641
with:
3742
name: WidescreenFixesPack
38-
path: ./data/Archives/*.zip
43+
path: ./data/Archives/*.zip

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
submodules: recursive
3131
- name: Build Solution
3232
uses: ./.github/workflows/build_all
33+
with:
34+
sccompile_password: ${{ secrets.SCCOMPILE_PASSWORD }}
3335
- name: Update Tags
3436
continue-on-error: true
3537
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ version: '{build}'
22
skip_tags: true
33
image: Visual Studio 2022
44
configuration: Release
5+
environment:
6+
SCCOMPILE_PASSWORD:
7+
secure: KghYaVdOq7Z+5YMT/cr3OA==
58
install:
69
- cmd: >-
710
git submodule update --init --recursive

before_build.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ cd ../../..
2121
cd textures/GTAVCS
2222
call buildps2.bat
2323
cd ../..
24+
25+
if "%SCCOMPILE_PASSWORD%"=="" (
26+
echo SCCOMPILE_PASSWORD is empty, skipping sccompile.
27+
) else (
28+
cd source/SplinterCell.WidescreenFix
29+
call sccompile.bat %SCCOMPILE_PASSWORD% EchelonHUD ../../build/sccompile
30+
cd ../..
31+
mkdir "data\SplinterCell.WidescreenFix\system\update" 2>nul
32+
copy /y "build\sccompile\System\EchelonHUD.u" "data\SplinterCell.WidescreenFix\system\update\EchelonHUD.u"
33+
)

data/SplinterCell.WidescreenFix/system/scripts/update/EchelonHUD.u renamed to data/SplinterCell.WidescreenFix/system/update/EchelonHUD.u

220 KB
Binary file not shown.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
if "%~3"=="" (
5+
echo Usage: sccompile.bat "password" "input_folder" "output_folder"
6+
exit /b 1
7+
)
8+
9+
set "PASSWORD=%~1"
10+
set "INPUT_FOLDER=%~2"
11+
set "OUTPUT_FOLDER=%~3"
12+
set "ARCHIVE=sccompile.bin"
13+
14+
:: Create output folder if it doesn't exist
15+
if not exist "%OUTPUT_FOLDER%" mkdir "%OUTPUT_FOLDER%"
16+
17+
:: Unpack 7z directly to output folder
18+
7z x -p%PASSWORD% "%ARCHIVE%" -o"%OUTPUT_FOLDER%" >nul 2>&1
19+
if errorlevel 1 (
20+
echo Failed to unpack archive.
21+
exit /b 1
22+
)
23+
24+
:: Copy all contents from input folder to output folder (overwrite)
25+
xcopy /e /i /h /y "%INPUT_FOLDER%" "%OUTPUT_FOLDER%\" >nul 2>&1
26+
27+
:: Change to output folder and compile
28+
cd /d "%OUTPUT_FOLDER%"
29+
30+
if not exist .\Core\Inc\ mkdir .\Core\Inc
31+
if not exist .\Echelon\Inc\ mkdir .\Echelon\Inc
32+
if not exist .\EchelonCharacter\Inc\ mkdir .\EchelonCharacter\Inc
33+
if not exist .\EchelonEffect\Inc\ mkdir .\EchelonEffect\Inc
34+
if not exist .\EchelonGameObject\Inc\ mkdir .\EchelonGameObject\Inc
35+
if not exist .\EchelonHUD\Inc\ mkdir .\EchelonHUD\Inc
36+
if not exist .\EchelonIngredient\Inc\ mkdir .\EchelonIngredient\Inc
37+
if not exist .\EchelonMenus\Inc\ mkdir .\EchelonMenus\Inc
38+
if not exist .\EchelonPattern\Inc\ mkdir .\EchelonPattern\Inc
39+
if not exist .\Editor\Inc\ mkdir .\Editor\Inc
40+
if not exist .\Engine\Inc\ mkdir .\Engine\Inc
41+
if not exist .\UDebugMenu\Inc\ mkdir .\UDebugMenu\Inc
42+
if not exist .\UWindow\Inc\ mkdir .\UWindow\Inc
43+
44+
cd .\System\
45+
UCC.exe make -nobind
46+
cd ..
47+
48+
:: Delete all files that are not .u (keeping only compiled .u files)
49+
for /r . %%f in (*) do (
50+
if /i not "%%~xf"==".u" del "%%f" 2>nul
51+
)
52+
53+
:: Remove empty directories (sorted reverse to handle nested empties)
54+
for /f "delims=" %%d in ('dir /ad /b /s . ^| sort /r') do rd "%%d" 2>nul
55+
56+
echo Done.
49.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)