Move version number to separate file so CMake doesn't reconfigure when it changes

This commit is contained in:
sentientstardust
2026-05-12 03:00:59 +01:00
parent fdbbf5f135
commit d7c66ac575
12 changed files with 61 additions and 17 deletions

View File

@ -142,7 +142,7 @@ jobs:
- uses: actions/checkout@v6
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
ver_pure=$(cat version_number.txt)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"

View File

@ -53,7 +53,7 @@ jobs:
- name: Get the version and date on Ubuntu and macOS
if: runner.os != 'Windows'
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
ver_pure=$(cat version_number.txt)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"
@ -79,10 +79,7 @@ jobs:
$ver = "PR" + $prNumber
$git_commit_hash = "${{ github.event.pull_request.head.sha }}"
} else {
$versionContent = Get-Content version.inc -Raw
if ($versionContent -match 'set\(SoftFever_VERSION "(.*?)"\)') {
$ver = $matches[1]
}
$ver = (Get-Content version_number.txt -First 1).Trim()
$ver = "V$ver"
$git_commit_hash = ""
}