Skip to content

Commit

Permalink
simplify- no need for output variables
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Apr 22, 2024
1 parent 3e5cfdc commit 4d33c28
Showing 1 changed file with 12 additions and 37 deletions.
49 changes: 12 additions & 37 deletions .github/workflows/updateBuildYamls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defaults:
run:
shell: pwsh
jobs:
update-yaml-stable:
update-yamls:
name: Update ReleaseStageYaml for Stable Channel
timeout-minutes: 15
runs-on: ubuntu-20.04
Expand All @@ -42,14 +42,6 @@ jobs:
if ($stableValue -notmatch '\d+\.\d+\.\d+$') {
throw "stable release tag is not for a stable build: '$stableValue'"
}
Write-Verbose -Verbose "echo here"
echo "STABLE_VERSION=$stableValue" >> $env:GITHUB_OUTPUT
}
else
{
$stableValue = ''
echo "STABLE_VERSION=$stableValue" >> $env:GITHUB_OUTPUT
}
$previewValue = '${{ inputs.previewReleaseTag }}'
Expand All @@ -58,13 +50,6 @@ jobs:
if ($previewValue -notmatch '\d+\.\d+\.\d+-(preview|rc)\.\d+$') {
throw "preview release tag is not for a preview build: '$previewValue'"
}
echo "PREVIEW_VERSION=$previewValue" >> $env:GITHUB_OUTPUT
}
else
{
$previewValue = ''
echo "PREVIEW_VERSION=$previewValue" >> $env:GITHUB_OUTPUT
}
$ltsValue = '${{ inputs.ltsReleaseTag }}'
Expand All @@ -73,61 +58,51 @@ jobs:
if ($ltsValue -notmatch '\d+\.\d+\.\d+$') {
throw "lts release tag is not for a lts build: '$ltsValue'"
}
echo "LTS_VERSION=$ltsValue" >> $env:GITHUB_OUTPUT
}
else
{
$ltsValue = ''
echo "LTS_VERSION=$ltsValue" >> $env:GITHUB_OUTPUT
}
- name: Update ReleaseStageYaml file for Stable
env:
STABLE_VERSION: ${{ steps.validate-version.outputs.STABLE_VERSION }}
run: |
$stableValue = '${{ inputs.stableReleaseTag }}'
$toolsFolderPath = Join-Path -Path ${{ github.workspace }} -ChildPath 'tools'
$buildHelperFolderPath = Join-Path -Path $toolsFolderPath -ChildPath 'buildHelper'
$buildHelperModulePath = Join-Path -Path $buildHelperFolderPath -ChildPath 'buildHelper.psm1'
Import-Module $buildHelperModulePath
if (!($STABLE_VERSION -eq ""))
if (!($stableValue -eq ""))
{
Write-Verbose -Verbose "using stable version: $STABLE_VERSION"
./build.ps1 -UpdateBuildYaml -Channel stable -StableVersion $STABLE_VERSION -Verbose -Acr All -OsFilter All
Write-Verbose -Verbose "using stable version: $stableValue"
./build.ps1 -UpdateBuildYaml -Channel stable -StableVersion $stableValue -Verbose -Acr All -OsFilter All
}
else
{
# Use the version from channels.json when no version is provided
Write-Verbose -Verbose "not using stable version from input as value was $STABLE_VERSION"
Write-Verbose -Verbose "not using stable version from input as value was $stableValue"
./build.ps1 -UpdateBuildYaml -Channel stable -Verbose -Acr All -OsFilter All
}
- name: Update ReleaseStageYaml file for Preview
env:
PREVIEW_VERSION: ${{ steps.validateversion.outputs.PREVIEW_VERSION }}
run: |
$previewValue = '${{ inputs.previewReleaseTag }}'
$toolsFolderPath = Join-Path -Path ${{ github.workspace }} -ChildPath 'tools'
$buildHelperFolderPath = Join-Path -Path $toolsFolderPath -ChildPath 'buildHelper'
$buildHelperModulePath = Join-Path -Path $buildHelperFolderPath -ChildPath 'buildHelper.psm1'
Import-Module $buildHelperModulePath
if (!($PREVIEW_VERSION -eq ""))
if (!($previewValue -eq ""))
{
./build.ps1 -UpdateBuildYaml -Channel preview -PreviewVersion $PREVIEW_VERSION -Verbose -Acr All -OsFilter All
./build.ps1 -UpdateBuildYaml -Channel preview -PreviewVersion $previewValue -Verbose -Acr All -OsFilter All
}
else
{
# Use the version from channels.json when no version is provided
./build.ps1 -UpdateBuildYaml -Channel preview -Verbose -Acr All -OsFilter All
}
- name: Update ReleaseStageYaml file for LTS
env:
LTS_VERSION: ${{ steps.validateversion.outputs.LTS_VERSION }}
run: |
$ltsValue = '${{ inputs.ltsReleaseTag }}'
$toolsFolderPath = Join-Path -Path ${{ github.workspace }} -ChildPath 'tools'
$buildHelperFolderPath = Join-Path -Path $toolsFolderPath -ChildPath 'buildHelper'
$buildHelperModulePath = Join-Path -Path $buildHelperFolderPath -ChildPath 'buildHelper.psm1'
Import-Module $buildHelperModulePath
if (!($LTS_VERSION -eq ""))
if (!($ltsValue -eq ""))
{
./build.ps1 -UpdateBuildYaml -Channel lts -LtsVersion $LTS_VERSION -Verbose -Acr All -OsFilter All
./build.ps1 -UpdateBuildYaml -Channel lts -LtsVersion $ltsValue -Verbose -Acr All -OsFilter All
}
else
{
Expand Down

0 comments on commit 4d33c28

Please sign in to comment.