2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-07-19 11:46:31 +03:00

fixed version get in ci

This commit is contained in:
STAM 2025-07-16 16:19:36 +03:00
parent 4f4c940c32
commit 454666520d
No known key found for this signature in database
GPG Key ID: 711526C6938897F1

View File

@ -5,6 +5,7 @@ on:
branches: [master] branches: [master]
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- '.github/**'
pull_request: pull_request:
types: [opened, reopened, synchronize] types: [opened, reopened, synchronize]
@ -123,15 +124,24 @@ jobs:
id: get_version id: get_version
shell: pwsh shell: pwsh
run: | run: |
$line = Get-Content rehlds/version/appversion.h | Where-Object { $_ -match 'APP_VERSION' } $versionFile = "rehlds/version/appversion.h"
if ($line -match '"([^"]+)"') { if (-not (Test-Path $versionFile)) {
"version=$($matches[1])" >> $env:GITHUB_OUTPUT Write-Error "Version file not found: $versionFile"
Write-Host "Version found"
} else {
Write-Error "Version not found"
exit 1 exit 1
} }
$content = Get-Content $versionFile
foreach ($line in $content) {
if ($line -match '^\s*#define\s+APP_VERSION\s+"([^"]+)"') {
$version = $matches[1]
"version=$version" >> $env:GITHUB_OUTPUT
Write-Host "Found version: $version"
exit 0
}
}
Write-Error "APP_VERSION not found in file"
exit 1
- name: Show version - name: Show version
run: echo "Version is ${{ steps.get_version.outputs.version }}" run: echo "Version is ${{ steps.get_version.outputs.version }}"
- name: Edit resources at windows binaries - name: Edit resources at windows binaries