Skip to content

Commit

Permalink
Improve version handling in firmware build workflow
Browse files Browse the repository at this point in the history
This commit refines the version handling within the firmware build workflow. An empty string is initially assigned to the release version, then it's updated based on certain conditions. Consequently, the version input management is more accurate, securing the proper format for the release version.
  • Loading branch information
derskythe committed Dec 19, 2023
1 parent 0802191 commit 5064991
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-with-firmwware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
cd '${{ env.APP_PATH }}'
$sha = (git rev-parse --verify HEAD)
$releaseVersion = "$env:INPUT_VERSION"
$releaseVersion = ''
if ( [string]::IsNullOrWhitespace($env:INPUT_VERSION) ) {
$latestTag = ((gh release view --json tagName,url -R ${{ vars.REPO_SELF }}) | ConvertFrom-Json ).tagName
Expand All @@ -109,8 +109,12 @@ jobs:
$minorValue = [Convert]::ToInt32($minorValue) + 1
$latestTag = $latestTag.Substring(0, $lastIndex)
$releaseVersion = ('{0}.{1}', $latestTag, $minorValue.ToString())
$releaseVersion = ('{0}.{1}' -f $latestTag, $minorValue)
} else {
$releaseVersion = "$env:INPUT_VERSION"
}
Write-Output "::notice title=Obtain Version Number::$releaseVersion"
if ( $releaseVersion.StartsWith('v') ) {
$releaseVersion = $releaseVersion.Substring(1)
}
Expand Down

0 comments on commit 5064991

Please sign in to comment.