Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
165 changes: 147 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build and Release

on:
workflow_dispatch:
Expand All @@ -7,6 +7,7 @@ on:
- "*"
- "*/*"
- "**"
tags: ['v*']
pull_request:
branches:
- "*"
Expand All @@ -15,35 +16,42 @@ on:

jobs:
build-windows-release:
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
clean: true
submodules: recursive
fetch-depth: 0

- name: Check CMake version
run: cmake --version

- name: Setup Python
uses: actions/setup-python@v2

- name: Install CMake
uses: lukka/get-cmake@v.3.23.2

- name: Install latest conan
run: |
python -m pip install --upgrade pip
pip install conan

- name: Generate build files
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 16 2019" -A Win32
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 17 2022" -A Win32
cmake --build . --config Release

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sscanf-win-release
path: build/Release/sscanf.dll
name: windows-build
path: |
build/Release/sscanf.dll
sscanf2.inc
LICENSE
pawn.json
README.md

build-linux-release:
runs-on: ubuntu-latest
Expand All @@ -57,14 +65,11 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install g++-multilib
sudo apt-get install g++-multilib cmake

- name: Setup Python
uses: actions/setup-python@v2

- name: Install CMake
uses: lukka/get-cmake@v.3.23.2

- name: Install latest conan
run: |
python -m pip install --upgrade pip
Expand All @@ -81,13 +86,137 @@ jobs:
cd build
cmake --build . --config Release

- name: Rename libsscanf.so to sscanf.so
- name: Rename and upload artifacts
run: |
cd build
mv ./libsscanf.so ./sscanf.so

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-build
path: |
build/sscanf.so
sscanf2.inc
LICENSE
pawn.json
README.md

create-release-packages:
runs-on: windows-latest
needs: [build-windows-release, build-linux-release]

steps:
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-build
path: windows-files/

- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-build
path: linux-files/

- name: Check files structure
run: |
echo "=== Windows files ==="
Get-ChildItem -Path "windows-files" -Recurse -Force
echo "=== Linux files ==="
Get-ChildItem -Path "linux-files" -Recurse -Force

- name: Get version
run: |
$version = $env:GITHUB_SHA.Substring(0, 7)
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "Version: $version"

- name: Install 7-Zip
run: choco install 7zip -y

- name: Create Windows package
run: |
$dllPath = "windows-files/build/Release/sscanf.dll"
if (-not (Test-Path $dllPath)) {
Write-Host "Available files:"
Get-ChildItem -Path "windows-files" -Recurse
throw "Windows sscanf.dll not found at: $dllPath"
}

mkdir windows-package
cd windows-package

copy "..\$dllPath" amxsscanf.dll
copy ..\windows-files\LICENSE LICENSE
copy ..\windows-files\pawn.json pawn.json
copy ..\windows-files\README.md README.md
copy ..\windows-files\sscanf2.inc .\

mkdir components
copy "..\$dllPath" components\sscanf.dll

mkdir plugins
copy "..\$dllPath" plugins\sscanf.dll

mkdir pawno
cd pawno
mkdir include
copy ..\..\windows-files\sscanf2.inc include\sscanf2.inc
cd ..

mkdir qawno
cd qawno
mkdir include
copy ..\..\windows-files\sscanf2.inc include\sscanf2.inc
cd ..

7z a -tzip windows-$env:VERSION.zip *
cd ..

- name: Create Linux package
run: |
$soPath = "linux-files/build/sscanf.so"
if (-not (Test-Path $soPath)) {
Write-Host "Available files:"
Get-ChildItem -Path "linux-files" -Recurse
throw "Linux sscanf.so not found at: $soPath"
}

mkdir linux-package
cd linux-package

copy "..\$soPath" amxsscanf.so
copy ..\linux-files\LICENSE LICENSE
copy ..\linux-files\pawn.json pawn.json
copy ..\linux-files\README.md README.md
copy ..\linux-files\sscanf2.inc .\

mkdir components
copy "..\$soPath" components\sscanf.so

mkdir plugins
copy "..\$soPath" plugins\sscanf.so

mkdir pawno
cd pawno
mkdir include
copy ..\..\linux-files\sscanf2.inc include\sscanf2.inc
cd ..

mkdir qawno
cd qawno
mkdir include
copy ..\..\linux-files\sscanf2.inc include\sscanf2.inc
cd ..

7z a -ttar -so -an * | 7z a -si linux-$env:VERSION.tar.gz
cd ..

- name: Upload release packages
uses: actions/upload-artifact@v4
with:
name: sscanf-linux-release
path: build/sscanf.so
name: release-packages
path: |
windows-package/*.zip
linux-package/*.gz
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
url = https://github.com/martinmoene/span-lite.git
[submodule "subhook"]
path = subhook
url = https://github.com/Zeex/subhook.git
url = https://github.com/devbluen/subhook.git
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3225,3 +3225,7 @@ the Initial Developer. All Rights Reserved.
* `SSCANF_GetErrorSpecifier` to get the error position in failure cases.
* `SSCANF_Debug` to dump a load of useful debugging information.

### Modification sscanf 2.15.1 - 02/09/2025
* Added hook `SSCANF_SetPlayerName`.
* The letters `u`, `q`, `r` have been updated to account for the case and length of the player/bot name. It works when using `MATCH_NAME_SIMILARITY` = `-1.0` (default).

Loading