Skip to content

Commit

Permalink
Build with the correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
dalyIsaac committed Jun 26, 2022
1 parent 2d674e0 commit ce1a093
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Determine channel
- name: Get variables
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$channel = $null
$isPrerelease = $true
if ($env:GITHUB_REF -eq "refs/heads/main") {
$channel = "alpha"
} elseif ($env:GITHUB_REF.StartsWith("refs/heads/release/")) {
$channel = "beta"
} elseif ($env:GITHUB_REF.StartsWith("refs/tags/")) {
$channel = "stable"
$isPrerelease = $false
} else {
throw "Unsupported ref: $env:GITHUB_REF"
}
$isPrerelease = $isPrerelease.ToString().ToLower()
"channel=${channel}" >> $env:GITHUB_ENV
"isPrerelease=${isPrerelease}" >> $env:GITHUB_ENV
$channel, $isPrerelease = .\scripts\Get-Channel.ps1
$currentRelease = .\scripts\Get-CurrentWhimRelease.ps1 -Channel $channel
$version = "v${currentRelease}"
"Version=${version}" >> $env:GITHUB_ENV
- name: Restore dependencies
run: |
Expand All @@ -89,7 +79,10 @@ jobs:

- name: Build
run: |
msbuild Whim.sln /p:Configuration=$env:Configuration /p:Platform=$env:Platform
msbuild Whim.sln `
/p:Configuration=$env:Configuration `
/p:Platform=$env:Platform `
/p:Version=$env:Version
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
Expand All @@ -100,15 +93,11 @@ jobs:
Platform: ${{ matrix.platform }}
run: |
$installerPath = .\scripts\Create-Installer.ps1 -Architecture $env:Platform
"installerPath=${installerPath}" >> $env:GITHUB_ENV
"InstallerPath=${installerPath}" >> $env:GITHUB_ENV
- name: Upload release assets
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$channel, $isPrerelease = .\scripts\Get-Channel.ps1
$currentRelease = .\scripts\Get-CurrentWhimRelease.ps1 -Channel $channel
$currentRelease = "v${currentRelease}"
gh release upload "$currentRelease" $env:installerPath
gh release upload "${env:Version}" "${env:InstallerPath}"

0 comments on commit ce1a093

Please sign in to comment.