-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: force config file for release please and update resource file
- Loading branch information
Showing
7 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "1.2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
{ | ||
"release-type": "simple", | ||
"extra-files": [ | ||
"source/version.h", | ||
"version.txt", | ||
{ | ||
"type": "regex", | ||
"path": "source/resource.rc", | ||
"regex": "(?<major>\\d+),(?<minor>\\d+),(?<patch>\\d+)(-(?<preRelease>[\\w.]+))?(\\+(?<build>[-\\w.]+))?", | ||
"replacement": "${major},${minor},${patch}${preRelease?'-${preRelease}'}${build?'+${build}'}" | ||
} | ||
] | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"release-type": "simple", | ||
"extra-files": [ | ||
"source/version.h" | ||
], | ||
"packages": { | ||
".": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Updates the versions in /source/resource.rc based on the version in version.txt | ||
|
||
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | ||
$versionFilePath = Join-Path -Path $scriptDir -ChildPath '..\version.txt' | ||
$resourceFilePath = Join-Path -Path $scriptDir -ChildPath '..\source\resources.rc' | ||
|
||
$version = Get-Content $versionFilePath | Select-Object -First 1 | ||
$versionParts = $version -split '\.' | ||
|
||
if ($versionParts.Length -ne 3) { | ||
Write-Error "Version '$version' is not in expected format 'X.Y.Z'" | ||
Exit 1 | ||
} | ||
|
||
$major = $versionParts[0] | ||
$minor = $versionParts[1] | ||
$patch = $versionParts[2] | ||
$build = '0' # Assuming build number is 0 | ||
|
||
$versionCommaText = "$major,$minor,$patch,$build" | ||
$versionDotText = "$major.$minor.$patch.$build" | ||
|
||
$content = Get-Content $resourceFilePath -Raw | ||
|
||
# Regex to match the version pattern in "1,2,3,4" form | ||
$content = $content -creplace '\d+,\d+,\d+,\d+', $versionCommaText | ||
# Regex to match the version pattern in "1.2.3.4" form | ||
$content = $content -creplace '\d+\.\d+\.\d+\.\d+', $versionDotText | ||
|
||
$content | Out-File -FilePath $resourceFilePath -Encoding UTF8 -NoNewline | ||
Write-Host "Updated $resourceFilePath with version $versionCommaText and $versionDotText" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#pragma once | ||
constexpr const wchar_t APP_VERSION[] = L"1.2.0"; | ||
constexpr const wchar_t APP_VERSION[] = L"1.2.0"; // x-release-please-version |