Skip to content

Commit

Permalink
fix fix fix
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Nov 22, 2023
1 parent d0d36e6 commit 0e76bff
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
dry-run: ${{ steps.info.outputs.dry-run }}

steps:
- name: Get dry run
id: get-dry-run
- name: Package information
id: info
shell: pwsh
run: |
$IsMasterBranch = ('${{ github.ref_name }}' -eq 'master')
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
run: |
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
$csprojPath = "dotnet\Devolutions.MsRdpEx\Devolutions.MsRdpEx.csproj"
$csprojXml = [xml](Get-Content $csprojPath)
$csprojXml.Project.PropertyGroup[0].SelectSingleNode('Version').InnerText = $PackageVersion
$csprojXml.Save((Get-Item $csprojPath).FullName)
$csprojContent = Get-Content $csprojPath -Raw
$csprojContent = $csprojContent -Replace '(<Version>).*?(</Version>)', "<Version>$PackageVersion</Version>"
Set-Content -Path $csprojPath -Value $csprojContent -Encoding UTF8
- name: Cache Detours (${{matrix.arch}})
id: cache-detours
Expand Down Expand Up @@ -140,9 +140,9 @@ jobs:
run: |
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
$csprojPath = "dotnet\Devolutions.MsRdpEx\Devolutions.MsRdpEx.csproj"
$csprojXml = [xml](Get-Content $csprojPath)
$csprojXml.Project.PropertyGroup[0].SelectSingleNode('Version').InnerText = $PackageVersion
$csprojXml.Save((Get-Item $csprojPath).FullName)
$csprojContent = Get-Content $csprojPath -Raw
$csprojContent = $csprojContent -Replace '(<Version>).*?(</Version>)', "<Version>$PackageVersion</Version>"
Set-Content -Path $csprojPath -Value $csprojContent -Encoding UTF8
- name: Prepare dependencies
shell: pwsh
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
path: package/*.nupkg

publish:
name: Publish NuGet package
name: Publish packages
runs-on: ubuntu-22.04
needs: [preflight, build-native, build-managed]
environment: ${{ needs.preflight.outputs.package-env }}
Expand Down Expand Up @@ -209,3 +209,30 @@ jobs:
} else {
& 'dotnet' $PushArgs
}
- name: Create GitHub release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: package
run: |
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
$DryRun = [System.Boolean]::Parse('${{ needs.preflight.outputs.dry-run }}')
$HashPath = 'checksums'
$Files = Get-Item * | % { Get-FileHash -Algorithm SHA256 $_.FullName }
$Files | % { "$($_.Hash) $(Split-Path $_.Path -Leaf)" } | Out-File -FilePath $HashPath -Append -Encoding ASCII
echo "::group::checksums"
Get-Content $HashPath
echo "::endgroup::"
$ReleaseTag = "v$Version"
$ReleaseTitle = "MsRdpEx v${Version}"
$Repository = $Env:GITHUB_REPOSITORY
if ($DryRun) {
Write-Host "Dry Run: skipping GitHub release!"
} else {
& gh release create $ReleaseTag --repo $Repository --title $ReleaseTitle ./*
}

0 comments on commit 0e76bff

Please sign in to comment.