Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes #143

Closed
wants to merge 176 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
3a52c9e
fix error in 004E allowing to run multiple missions
x87 Aug 26, 2023
6ffd3ab
reset variable before writing a value from file
x87 Aug 26, 2023
79dfcb0
use readString SDK to get the first argument in 0AF5
x87 Sep 2, 2023
a286b86
Fixed text buffers size.
MiranDMC Sep 2, 2023
491cd0b
Check if 'arguments count' param is present before trying to read it.
MiranDMC Sep 2, 2023
2fdb81c
0AB2 param count argument made optional.
MiranDMC Sep 2, 2023
53550d9
fixup! 0AB2 param count argument made optional.
MiranDMC Sep 2, 2023
a3041e1
cleo_call and cleo_return scope now save and restore GOSUB's call stack.
MiranDMC Sep 3, 2023
03bdb17
Update project configuration (#102)
MiranDMC Sep 19, 2023
efe00ef
Add opcode 0DD5 (get_platform) (#100)
MiranDMC Sep 19, 2023
98a4911
Introducing cleo modules (#101)
MiranDMC Sep 30, 2023
9868b1b
Paths handling updates (#103)
MiranDMC Oct 4, 2023
ada6d50
Update CDebug.h
x87 Oct 4, 2023
02617e0
Removed duplicated declarations of multiple objects. (#106)
MiranDMC Oct 6, 2023
34d37bc
opcodes 0AAB, 0AE4, 0AE5, 0AE1, 0AE2 and 0AE3 moved from CLEO to File…
MiranDMC Oct 7, 2023
49f09eb
sort source files using 4 new filters
x87 Oct 12, 2023
b5244a3
added debug_on and debug_off opcodes
MiranDMC Oct 13, 2023
22c527a
Allow replacing CLEO's opcodes.
MiranDMC Oct 13, 2023
fb4deda
fixup! Allow replacing CLEO's opcodes.
MiranDMC Oct 13, 2023
ae56681
fixup! Allow replacing CLEO's opcodes.
MiranDMC Oct 13, 2023
6f5126a
Fix to WriteStringParam.
MiranDMC Oct 14, 2023
6e8691b
Added missing changes to CHANGELOG.md (#112)
MiranDMC Oct 15, 2023
97b56ed
Generate complete directory tree in release archives (#115)
MiranDMC Oct 15, 2023
ab7b0b7
Main menu cleo text aspect fix (#114)
MiranDMC Oct 15, 2023
7830023
Added 2000 and 2001 opcodes. (#111)
MiranDMC Oct 15, 2023
03c65b1
Added callback for drawing finished. (#116)
MiranDMC Oct 16, 2023
2c7ec21
Added full_path argument to get_script_filename opcode. (#117)
MiranDMC Oct 16, 2023
95f1e68
clearing mission locals on CLEO mission start (#118)
MiranDMC Oct 17, 2023
da9dfd4
Fixed bug in 00CC (#121)
MiranDMC Oct 20, 2023
62f7c7b
Fixed read bug when provided target buffer size is greater than 255. …
MiranDMC Oct 20, 2023
e6f5591
ReadFormattedString result always null terminated (#124)
MiranDMC Oct 22, 2023
63692a7
Small features and refactoring (#125)
MiranDMC Oct 22, 2023
ade954d
script parameter read write type validation (#123)
MiranDMC Oct 22, 2023
e42a23b
Fixed renamed function calls. (#126)
MiranDMC Oct 22, 2023
cd3d9a2
Grouping repeated messages in screen log. (#122)
MiranDMC Oct 22, 2023
cc82d9d
Changed CLEO version references from 4 to 5.
MiranDMC Oct 23, 2023
fa82b4f
Changelog updated.
MiranDMC Oct 23, 2023
504bc72
Merge pull request #1 from cleolibrary/update_to_CLEO5
x87 Oct 23, 2023
ec679b8
fix ResolvePath returning path separator on end of workdir
MiranDMC Oct 23, 2023
c429b6d
fixup! fix ResolvePath returning path separator on end of workdir
MiranDMC Oct 23, 2023
ac1e6f3
Merge pull request #3 from cleolibrary/fix_ResolvePath_returning_path…
MiranDMC Oct 24, 2023
940c956
Fix read formatted string (#2)
MiranDMC Oct 24, 2023
600e7bd
Added loading plugins from legacy location
MiranDMC Oct 24, 2023
af9bf5c
setup github workflow for automatic releases (#6)
x87 Oct 26, 2023
f8b8e2d
Error messages updates. (#5)
MiranDMC Oct 26, 2023
a912845
changelog updated (#8)
MiranDMC Oct 26, 2023
7b17b20
Add callbacks for opcode processing events (#7)
MiranDMC Oct 26, 2023
ba095df
Update CHANGELOG.md (#10)
x87 Oct 27, 2023
7f674cd
Fix for backward compatibility with mod loader (#9)
MiranDMC Oct 27, 2023
91cdc4f
Paths resolving updates (#12)
MiranDMC Oct 28, 2023
1ff1b4b
Error messages update (#13)
MiranDMC Oct 29, 2023
f6e1f6d
Fix string view of reallocated string. (#14)
MiranDMC Oct 30, 2023
93757b0
Http links of debug opcodes fixed. (#15)
MiranDMC Oct 30, 2023
a3c6924
support UAL's hack of find file APIs (#16)
MiranDMC Oct 30, 2023
1d34952
updated virtual paths info (#17)
MiranDMC Oct 30, 2023
f43116f
debug opcodes renumbered to unoccupied ids (#20)
MiranDMC Nov 1, 2023
2729a3c
Check for multiple CLEO.asi instances loaded (#19)
MiranDMC Nov 1, 2023
7c6e21b
Cleo return arguments count check (#18)
MiranDMC Nov 1, 2023
c4fa849
custom opcodes handler fix
MiranDMC Nov 2, 2023
f606c18
Fixes (#23)
MiranDMC Nov 2, 2023
c48d69e
CLEO paths handling updates.
MiranDMC Nov 3, 2023
4d03408
ensure eax is reset before calling a function (#24)
x87 Nov 8, 2023
30df31b
Argument count validation in 0AA5-0AA8 opcodes.
MiranDMC Nov 8, 2023
d0a0cdc
Readme updates.
MiranDMC Nov 8, 2023
6c0b3d2
Fix crash in ScriptDeleteDelegate
MiranDMC Nov 11, 2023
9185b9e
New opcode sign_extend
MiranDMC Nov 11, 2023
c46fd99
Fixed support of provided custom work dir in path resolving.
MiranDMC Nov 11, 2023
ecec111
Fixed thread name unterminated string uses.
MiranDMC Nov 11, 2023
a137881
Argument count mismatch validation in 0AB2 split into critical and no…
MiranDMC Nov 12, 2023
26d93da
Bug fix of thread name print. (#31)
MiranDMC Nov 12, 2023
a03ca23
Inheriting compatibility mode from parent script. Deducing compatibil…
MiranDMC Nov 12, 2023
9fa345f
Fixed missing dependency (#33)
MiranDMC Nov 12, 2023
8c9f17e
New opcode cleo return with (#39)
MiranDMC Nov 13, 2023
19389e7
fix opcode id typo (#40)
x87 Nov 15, 2023
6265ebf
crash prevention in opcodes 0A8C and 0A8D (#42)
MiranDMC Nov 15, 2023
b527a7f
Fix screen logging lines ending with space char (#41)
MiranDMC Nov 15, 2023
7d9960e
Fix load script path (#45)
MiranDMC Nov 17, 2023
989bda5
fix 0AB1 support of string array input arguments (#47)
MiranDMC Nov 17, 2023
7558faf
Fixed crash when creating script from label (#49)
MiranDMC Nov 18, 2023
5035fda
Fixed 0AB1 input argument count verification for string arrays. (#50)
MiranDMC Nov 19, 2023
9fa9b50
Implemented proper handling of game start-end events. (#48)
MiranDMC Dec 3, 2023
44b761b
new return opcodes (#44)
MiranDMC Dec 20, 2023
91e78cd
Return strings support (#51)
MiranDMC Jan 2, 2024
2606b2e
forget_memory opcode (#53)
MiranDMC Jan 6, 2024
d560e83
Parameters validation in call_function opcodes. (#56)
MiranDMC Jan 6, 2024
5251bbb
File related opcodes updates (#57)
MiranDMC Jan 30, 2024
b83fa35
MemoryOperations plugin (#54)
MiranDMC Feb 19, 2024
d5106ee
copy .cleo5 plugins
x87 Feb 19, 2024
d34aca5
Opcodes 0A8E, 0A8F, 0A90, 0A91 moved to IntOperations plugin (#62)
MiranDMC Feb 22, 2024
2f19740
String args support for legacy opcodes (#61)
MiranDMC Feb 24, 2024
9228040
Audio plugin (#63)
MiranDMC Feb 25, 2024
a2ff5d4
Fixed problems with ModLoader support. (#65)
MiranDMC Feb 26, 2024
a7d4341
Remove legacy leftovers (#66)
MiranDMC Feb 26, 2024
a1044ef
fix missing bass.h (#67)
MiranDMC Feb 26, 2024
228d4e5
fix missing bass.lib (#68)
MiranDMC Feb 26, 2024
7898104
Add missing bass.lib file to repository (#69)
MiranDMC Feb 26, 2024
bdccfa3
Added unit test scripts to the release pack (#70)
MiranDMC Feb 26, 2024
a8d1f62
Added get/set_audio_stream_progress opcodes to the Changelog (#71)
MiranDMC Feb 26, 2024
3fc4b36
add_dynamic_GXT_entry opcode bug fix (#73)
MiranDMC Feb 27, 2024
1768497
ReadStringParam bug fix (#74)
MiranDMC Feb 27, 2024
274a7fa
fix audio plugin file extension (#75)
MiranDMC Feb 27, 2024
ac40fa1
opcode 0AA4 fix (#78)
MiranDMC Feb 27, 2024
e6ab655
Allow literal '0' as float parameter when calling opcodes (#77)
MiranDMC Feb 28, 2024
1175adc
Audio plugin name fixed (#80)
MiranDMC Mar 1, 2024
01a91a8
Filesystem unit tests updated. (#81)
MiranDMC Mar 1, 2024
9adbfbf
Opcode string params handling tweaked (#76)
MiranDMC Mar 1, 2024
fb02e50
Implemented SBL json info support. (#72)
MiranDMC Mar 1, 2024
8386bb1
0AE2, 0AE3 opcodes fix (#83)
MiranDMC Mar 1, 2024
aace429
0AA6 pointer validation relaxed for legacy scripts (#82)
MiranDMC Mar 1, 2024
77e52a2
Update main.yml (#84)
x87 Mar 1, 2024
32e59cf
Fixed opcodes 0A8D, 2401, 2402 types invalid data type restrictions. …
MiranDMC Mar 1, 2024
f76bea0
OPCODE_READ_PARAM_FILEPATH should return pointer to buffer with resol…
x87 Mar 2, 2024
7d28bb8
Fixed OPCODE_READ_PARAM_FILEPATH macro. (#87)
MiranDMC Mar 2, 2024
27cb5dc
memory operation tests (#90)
x87 Mar 3, 2024
a77505c
Minor fixes in Audio plugin. Fixed test scripts. (#91)
MiranDMC Mar 4, 2024
c23720b
Fixed handled opcode parameters counting. Bug fixes. (#93)
MiranDMC Mar 4, 2024
edbed65
File related opcodes fixes. More tests. (#88)
MiranDMC Mar 5, 2024
a309ebf
Restored original return type in CLEO_GetOperandType export. (#95)
MiranDMC Mar 6, 2024
6a21464
CLEO testing library (#92)
x87 Mar 6, 2024
338f6f8
Added argument names to OpcodeInfoDatabase
MiranDMC Mar 9, 2024
cf7c5ab
Loading opcodes database in separated thread.
MiranDMC Mar 10, 2024
bae44ba
Fix of text mode support for file streams.
MiranDMC Mar 10, 2024
63e98d6
SCM function handling by GOSUB return.
MiranDMC Mar 7, 2024
dfb5bca
Review fix.
MiranDMC Mar 7, 2024
cfbd9bf
fixup! Review fix.
MiranDMC Mar 7, 2024
a4a64b6
update tests
x87 Mar 10, 2024
8447beb
Reduced amount of log entries from FXT files parsing. (#102)
MiranDMC Mar 12, 2024
c5f4858
Let LoadLibrary API resolve library paths itself. (#101)
MiranDMC Mar 12, 2024
339b5ac
Allow 0051 to return cleo functions in main.scm too. (#103)
MiranDMC Mar 12, 2024
f8cc37d
Bugfix of cleo_call string variables support. (#105)
MiranDMC Mar 18, 2024
a403588
Implemented audio stream types (sfx/music). (#106)
MiranDMC Mar 19, 2024
d41d80d
exit from a function with single return is always false condition (#107)
x87 Mar 19, 2024
130f720
New Text plugin. (#104)
MiranDMC Mar 21, 2024
ef11b98
Fix of CFileMgr.cpp path (#108)
MiranDMC Mar 21, 2024
61d8d12
Documentation updates (#109)
MiranDMC Mar 22, 2024
52b6513
Updates in load_dynamic_library opcode. (#110)
MiranDMC Mar 23, 2024
f363d5f
Removed duplicated address checks from memory read/write opcodes. (#112)
MiranDMC Mar 26, 2024
7bf06d1
Minor fixes. (#113)
MiranDMC Mar 28, 2024
398871a
Fixed style param when printing big formatted texts. (#114)
MiranDMC Mar 28, 2024
66f90f8
New opcode display_text_formatted (#115)
MiranDMC Mar 29, 2024
e01844d
Update Workflows, Add Dependabot (#52)
CanerKaraca23 Apr 2, 2024
5730ef2
Fixed TestCheat opcode. (#120)
MiranDMC Apr 8, 2024
d8fd718
Update README.md (#118)
x87 Apr 8, 2024
fff6c12
IntOperations turned into Math plugin (#116)
MiranDMC Apr 8, 2024
e24e326
Update CModuleSystem.cpp (#121)
x87 Apr 9, 2024
3535844
release with multiple asi loader versions (#119)
x87 Apr 9, 2024
0ebf3c4
update test framework to latest sb (#117)
x87 Apr 9, 2024
95dea91
Added info about compatibility mode to some errors. (#122)
MiranDMC Apr 11, 2024
8acb334
Enabled support of export index as argument in get_proc_address opcod…
MiranDMC Apr 13, 2024
c36999c
Implementing cleo_arg_count opcode (#125)
MiranDMC Apr 17, 2024
352f25c
More detailed error message box for invalid input string string param…
MiranDMC Apr 17, 2024
fce8a8f
Ignoring unsupported commands when loading opcodes database. (#128)
MiranDMC Apr 20, 2024
42dcc5f
Fixed mission code offsets info in error messages. (#130)
MiranDMC Apr 26, 2024
d710d0a
legacy behavior for passing string variables into functions (#131)
x87 Apr 26, 2024
49c0d36
use LTS node (#132)
x87 Apr 30, 2024
9f5fec7
Update CHANGELOG.md (#134)
x87 May 1, 2024
b4d6598
Fixed parsing of module-export identifier string. (#135)
MiranDMC May 1, 2024
50df696
add code sign workflow
x87 Jun 4, 2024
302843f
Malware detection fixes (#144)
MiranDMC Jun 7, 2024
cec7939
disable code signing (#145)
x87 Jun 7, 2024
7694d3a
use VS 2019 (#146)
x87 Jun 7, 2024
7795c5c
switch to older Win 10 SDK (#147)
x87 Jun 7, 2024
7be8ff3
Malware detection fixes (#149)
MiranDMC Jun 11, 2024
608c25c
Malware detection fixes (#150)
MiranDMC Jun 11, 2024
9dfd475
Updates and refactoring (#152)
MiranDMC Jun 15, 2024
1caca4b
Fixed twice listing plugin files. (#153)
MiranDMC Jun 15, 2024
0da5208
Unrelated exports moved out from CCustomOpcodeSystem class. (#154)
MiranDMC Jun 15, 2024
ddbc910
Fixed listing already skipped duplicate files.
MiranDMC Jun 16, 2024
7a93a15
Enabled CLEO_GetScriptFilename to return info from inactive threads. …
MiranDMC Jun 22, 2024
0c368da
Fixed script path info of main.scm (#159)
MiranDMC Jun 23, 2024
65eca0c
Enabled support of network sources in audio stream opcodes. (#158)
MiranDMC Jun 23, 2024
e6dc8fc
Cleo scripts listing with modloader (#160)
MiranDMC Jun 24, 2024
5c5d2a4
Fixes and refactor (#161)
MiranDMC Jun 24, 2024
f4ee380
New get_file_write_time opcode (#162)
MiranDMC Jun 24, 2024
733598c
Fixed detection of variable strings as constants in get_var_pointer o…
MiranDMC Jul 21, 2024
b0097b6
Allowed argument count missmatch in call function opcodes in legacy m…
MiranDMC Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
165 changes: 165 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: CLEO 5 Release Build

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+**'

jobs:
build:
runs-on: windows-2022

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Read Version Tag
id: read_version
run: node.exe .github/workflows/version.js

- name: Core - Build
shell: cmd
run: |
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild -m CLEO5.sln /property:Configuration=Release /property:Platform=GTASA

- name: Core - Sign
uses: x87/code-sign-action@develop
with:
certificate: '${{ secrets.DIG_KEY_CERT }}'
password: '${{ secrets.DIG_KEY_PWD }}'
certificatename: 'Seemann'
description: 'CLEO 5'
timestampUrl: 'http://timestamp.digicert.com'
filename: './.output/Release/cleo.asi'

- name: Core - VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_KEY }}
files: './.output/Release/CLEO.asi'

- name: Plugins - Build
shell: cmd
run: |
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild -m cleo_plugins/CLEO_Plugins.sln /property:Configuration=Release /property:Platform=x86

- name: Plugins - Sign
uses: x87/code-sign-action@develop
with:
certificate: '${{ secrets.DIG_KEY_CERT }}'
password: '${{ secrets.DIG_KEY_PWD }}'
certificatename: 'Seemann'
description: 'CLEO 5 Plugin'
timestampUrl: 'http://timestamp.digicert.com'
folder: './cleo_plugins/.output'

- name: Plugins - VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_KEY }}
files: './cleo_plugins/.output/*.cleo'

- name: Gather Output Files
id: prepare_archive
shell: cmd
run: |
@REM create output directory
mkdir .output\Release\cleo
mkdir .output\Release\cleo\.config
mkdir .output\Release\cleo\cleo_modules
mkdir .output\Release\cleo\cleo_plugins
mkdir .output\Release\cleo\cleo_saves
mkdir .output\Release\cleo\cleo_text
mkdir .output\Release\cleo_readme

@REM copy files
copy source\cleo_config.ini .output\Release\cleo\.cleo_config.ini
copy cleo_plugins\.output\*.cleo .output\Release\cleo\cleo_plugins
copy cleo_plugins\.output\*.ini .output\Release\cleo\cleo_plugins
copy cleo_plugins\Audio\bass\bass.dll .output\Release\bass.dll
xcopy /E /I tests .output\Release\cleo

@REM copy SDK
copy .output\Release\CLEO.lib cleo_sdk\CLEO.lib

@REM download Sanny Builder Library json
curl https://raw.githubusercontent.com/sannybuilder/library/master/sa/sa.json -o .output\Release\cleo\.config\sa.json

- name: Convert Markdown to HTML
id: md_to_html
run: |
npm install showdown
node.exe .github/workflows/markdown.js
move README.html .output\Release\cleo_readme\README.html
move CHANGELOG.html .output\Release\cleo_readme\CHANGELOG.html

- name: Download ASI Loaders
id: download_asi_loaders
shell: cmd
run: |
xcopy /E /I .output\Release .output\Release_with_Silent_ASI_Loader
xcopy /E /I .output\Release .output\Release_with_Ultimate_ASI_Loader

@REM install Silent's ASI Loader
curl https://silent.rockstarvision.com/uploads/silents_asi_loader_13.zip -o silents_asi_loader_13.zip
powershell.exe -NoP -NonI -Command "Expand-Archive '.\silents_asi_loader_13.zip' '.\.output\Release_with_Silent_ASI_Loader'"
move .output\Release_with_Silent_ASI_Loader\ReadMe.txt ".output\Release_with_Silent_ASI_Loader\cleo_readme\ASI Loader Readme.txt"
rmdir /s /q .output\Release_with_Silent_ASI_Loader\advanced_plugin_management_example
rmdir /s /q .output\Release_with_Silent_ASI_Loader\scripts

@REM install Ultimate ASI Loader
curl https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases/download/Win32-latest/vorbisFile-Win32.zip -L -o ual.zip
powershell.exe -NoP -NonI -Command "Expand-Archive '.\ual.zip' '.\.output\Release_with_Ultimate_ASI_Loader'"
rm .\.output\Release_with_Ultimate_ASI_Loader\vorbisFile-Win32.SHA512

- name: Pack Base Archive
uses: ThirteenAG/zip-release@master
with:
path: ./.output/Release/*
type: "zip"
filename: SA.CLEO_${{ github.ref_name }}.zip
exclusions: "*.pdb *.lib *.exp"

- name: Pack Base + Silent's ASI Loader
uses: ThirteenAG/zip-release@master
with:
path: ./.output/Release_with_Silent_ASI_Loader/*
type: "zip"
filename: SA.CLEO_${{ github.ref_name }}+Silent_ASI_Loader.zip
exclusions: "*.pdb *.lib *.exp"

- name: Pack Base + UAL
uses: ThirteenAG/zip-release@master
with:
path: ./.output/Release_with_Ultimate_ASI_Loader/*
type: "zip"
filename: SA.CLEO_${{ github.ref_name }}+Ultimate_ASI_Loader.zip
exclusions: "*.pdb *.lib *.exp"

- name: CLEO SDK
uses: ThirteenAG/zip-release@master
with:
path: ./cleo_sdk/*
type: "zip"
filename: SA.CLEO_${{ github.ref_name }}_SDK.zip
exclusions: "*.pdb *.exp"

- name: Upload Release
uses: ncipollo/release-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.read_version.outputs.version }}
bodyFile: 'changes.txt' # generated in read_version
tag: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
artifacts: "SA.CLEO_*.zip"
16 changes: 16 additions & 0 deletions .github/workflows/markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const showdown = require('showdown');
const {readFileSync, writeFileSync} = require('fs');

const md = new showdown.Converter({
literalMidWordUnderscores: true,
disableForced4SpacesIndentedSublists: true,
noHeaderId: true,
completeHTMLDocument: true,
simplifiedAutoLink: true,
});

const readme = md.makeHtml(readFileSync('README.md', 'utf8'));
const changelog = md.makeHtml(readFileSync('CHANGELOG.md', 'utf8'));

writeFileSync('README.html', readme, 'utf8');
writeFileSync('CHANGELOG.html', changelog, 'utf8');
91 changes: 91 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CLEO 5 Test Build

on:
push:
paths-ignore:
- ".github/*"
- "*.md"
pull_request:
types: [opened, reopened]
workflow_dispatch:

jobs:
build:
runs-on: windows-2022

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Core - Build
shell: cmd
run: |
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild -m CLEO5.sln /property:Configuration=Release /property:Platform=GTASA

- name: Core - Sign
uses: x87/code-sign-action@develop
with:
certificate: '${{ secrets.DIG_KEY_CERT }}'
password: '${{ secrets.DIG_KEY_PWD }}'
certificatename: 'Seemann'
description: 'CLEO 5'
timestampUrl: 'http://timestamp.digicert.com'
filename: './.output/Release/cleo.asi'

- name: Core - VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_KEY }}
files: './.output/Release/CLEO.asi'

- name: Plugins - Build
shell: cmd
run: |
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild -m cleo_plugins/CLEO_Plugins.sln /property:Configuration=Release /property:Platform=x86

- name: Plugins - Sign
uses: x87/code-sign-action@develop
with:
certificate: '${{ secrets.DIG_KEY_CERT }}'
password: '${{ secrets.DIG_KEY_PWD }}'
certificatename: 'Seemann'
description: 'CLEO 5 Plugin'
timestampUrl: 'http://timestamp.digicert.com'
folder: './cleo_plugins/.output'

- name: Plugins - VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_KEY }}
files: './cleo_plugins/.output/*.cleo'

- name: Gather Output Files
id: prepare_archive
shell: cmd
run: |
@REM create output directory
mkdir .output\Release\cleo
mkdir .output\Release\cleo\cleo_plugins

@REM copy files
copy third-party\bass\bass.dll .output\Release\bass.dll
copy source\cleo_config.ini .output\Release\cleo\.cleo_config.ini
copy cleo_plugins\.output\*.cleo .output\Release\cleo\cleo_plugins
copy cleo_plugins\.output\*.ini .output\Release\cleo\cleo_plugins

- name: Upload Result
uses: actions/upload-artifact@v4
with:
compression-level: 0
name: SA.CLEO5
path: |
.output\Release\*
!.output\Release\*.pdb
!.output\Release\*.lib
!.output\Release\*.exp
59 changes: 59 additions & 0 deletions .github/workflows/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const { appendFileSync, readFileSync, writeFileSync } = require("fs");
const { EOL } = require("os");
const { GITHUB_OUTPUT, GITHUB_REF_NAME } = process.env;

if (GITHUB_REF_NAME) {
const version = GITHUB_REF_NAME.startsWith("v") ? GITHUB_REF_NAME.slice(1) : GITHUB_REF_NAME;
addOutput("version", version);

// update cleo.h to replace version
const cleoH = readFileSync("cleo_sdk/cleo.h", { encoding: "utf-8" });

const [, main, major, minor] = version.match(/(\d+)\.(\d+)\.(\d+).*/);

const newCleoH = cleoH
.replace(/#define\s+CLEO_VERSION_MAIN\s+.*/, `#define CLEO_VERSION_MAIN ${main}`)
.replace(/#define\s+CLEO_VERSION_MAJOR\s+.*/, `#define CLEO_VERSION_MAJOR ${major}`)
.replace(/#define\s+CLEO_VERSION_MINOR\s+.*/, `#define CLEO_VERSION_MINOR ${minor}`)
.replace(/#define\s+CLEO_VERSION_STR\s+.*/, `#define CLEO_VERSION_STR "${version}"`);
writeFileSync("cleo_sdk/cleo.h", newCleoH, { encoding: "utf-8" });
}

const changelog = readFileSync("CHANGELOG.md", { encoding: "utf-8" });
writeFileSync("changes.txt", getChanges().join(EOL), { encoding: "utf-8" });

function addOutput(key, value) {
appendFileSync(GITHUB_OUTPUT, `${key}=${value}${EOL}`, { encoding: "utf-8" });
}

function getChanges() {
const lines = changelog.split(EOL);
const result = [
`## Download Instructions`,
`An ASI loader is required for CLEO 5 to work. CLEO 5 comes pre-packaged with several popular ASI Loaders ([Silent's ASI Loader](https://cookieplmonster.github.io/mods/gta-sa/#asiloader) and [Ultimate ASI Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader)).`,
`#### If you don't have an ASI loader installed already or unsure which one to download:`,
`- Download [CLEO ${GITHUB_REF_NAME} with Silent's ASI Loader](https://github.com/cleolibrary/CLEO5/releases/download/${GITHUB_REF_NAME}/SA.CLEO_${GITHUB_REF_NAME}+Silent_ASI_Loader.zip)`,
`#### If you prefer Ultimate ASI Loader:`,
`- Download [CLEO ${GITHUB_REF_NAME} with Ultimate ASI Loader](https://github.com/cleolibrary/CLEO5/releases/download/${GITHUB_REF_NAME}/SA.CLEO_${GITHUB_REF_NAME}+Ultimate_ASI_Loader.zip)`,
`#### If you have an ASI loader installed already:`,
`- Download [this archive](https://github.com/cleolibrary/CLEO5/releases/download/${GITHUB_REF_NAME}/SA.CLEO_${GITHUB_REF_NAME}.zip) which contains ONLY CLEO 5 library and plugins.`,
`## Installation`,
`- Unzip the archive to GTA San Andreas game directory.`,
`## Changelog`,
];

for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line.trimStart().startsWith("## ")) {
for (let j = i + 1; j < lines.length; j++) {
const line = lines[j];
if (line.trimStart().startsWith("## ")) {
return result;
}
result.push(line);
}
}
}

return result;
}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build/
output/
.output/
*.APS
*.VC.db
*.VC.opendb
Expand Down Expand Up @@ -38,4 +38,8 @@ output/
Debug/*
Release/*
ipch/
.vs/
.vs/
*.zip
*.lib
node_modules/
tests/**/*.s
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "plugin-sdk"]
path = third-party/plugin-sdk
url = https://github.com/DK22Pac/plugin-sdk
Loading
Loading