Skip to content

Commit

Permalink
Add windows version
Browse files Browse the repository at this point in the history
  • Loading branch information
phnzb committed Dec 11, 2023
1 parent b1ec959 commit ef7587e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Change version for non-release
if: github.ref_name != 'main'
run: |
$Version = ((((Select-String -Path nzbget.vcxproj -Pattern ";VERSION=")[0] -split(';'))[2] -split('='))[1]) -replace '"', ''
$Date=Get-Date -Format "yyyymmdd"
$NewVersion = "$Version-testing-$Date"
Get-Content nzbget.vcxproj | ForEach-Object {$_ -replace "VERSION=`"$Version`"", "VERSION=`"$NewVersion`""} | Set-Content nzbget.vcxproj
echo "NEW_VERSION=$NewVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build
run: |
.\windows\build-nzbget-vs22.bat
Expand All @@ -21,17 +30,14 @@ jobs:
if: github.ref_name != 'main'
run: |
$Output="c:\nzbget\build\output"
$NewVersion=$env:NEW_VERSION
ForEach ($File In Get-ChildItem -Path $Output -Filter "*.exe") {
$Version = $File.Name.split("-")[1]
If ($env:GITHUB_REF_NAME -ne "main") {
$Date=Get-Date -Format "yyyymmdd"
$NewVersion = "$Version-testing-$Date"
if ($env:GITHUB_REF_NAME -ne "develop") {
$Suffix = $env:GITHUB_REF_NAME.Replace("/","-")
$NewVersion = "$NewVersion-$Suffix"
}
Rename-Item -Path "$Output\$($File.Name)" -NewName $File.Name.Replace($Version, $NewVersion)
}
If ($env:GITHUB_REF_NAME -ne "main") {
if ($env:GITHUB_REF_NAME -ne "develop") {
$Suffix = $env:GITHUB_REF_NAME.Replace("/","-")
Rename-Item -Path "$Output\$($File.Name)" -NewName $File.Name.Replace($NewVersion, "$NewVersion-$Suffix")
}
}
}
- name: Upload build artifacts
Expand Down

0 comments on commit ef7587e

Please sign in to comment.