Skip to content

🎉 v1.3.1

🎉 v1.3.1 #1

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 6
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"
- name: Restore
run: dotnet restore ./installer/Pxp.wixproj
- name: Build MSI
shell: pwsh
run: |
$tagVersion = "${{ github.event.release.tag_name }}".TrimStart('v')
# Strip pre-release suffix (e.g., 1.1.1-beta -> 1.1.1)
$version = $tagVersion -replace '-.*$', ''
Write-Host "Tag: $tagVersion -> MSI Version: $version"
dotnet build ./installer/Pxp.wixproj -c Release -p:ProductVersion=$version
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
- name: Verify Build Output
shell: pwsh
run: |
Write-Host "=== Looking for output files ==="
$msiFiles = Get-ChildItem -Path "installer/bin/Release" -Filter "*.msi" -Recurse
if ($msiFiles) {
Write-Host "Found MSI files:"
$msiFiles | ForEach-Object {
Write-Host " - $($_.FullName) ($([math]::Round($_.Length / 1KB, 2)) KB)"
}
} else {
Write-Host "No .msi files found in installer/bin/Release!"
Write-Host ""
Write-Host "=== Directory contents ==="
Get-ChildItem -Path "installer/bin/Release" -Recurse | ForEach-Object { Write-Host $_.FullName }
exit 1
}
- name: Generate Checksum
shell: pwsh
run: |
$msiPath = Get-ChildItem -Path "installer/bin/Release" -Filter "*.msi" -Recurse | Select-Object -First 1
if (-not $msiPath) {
Write-Error "No MSI file found!"
exit 1
}
$hash = Get-FileHash -Path $msiPath.FullName -Algorithm SHA256
$checksumFile = "$($msiPath.DirectoryName)\$($msiPath.BaseName).sha256"
"$($hash.Hash) $($msiPath.Name)" | Out-File -FilePath $checksumFile -Encoding UTF8
Write-Host "✅ Checksum generated: $($hash.Hash)"
Write-Host "📝 Checksum file: $checksumFile"
- name: Code Sign MSI (Optional)
shell: pwsh
run: |
Write-Host "ℹ️ Code signing certificate not configured."
Write-Host "To enable code signing, add CODE_SIGNING_CERT and CODE_SIGNING_PASS secrets to the repository."
Write-Host "The MSI will be distributed with elevated privileges for trusted installation."
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
$msiPath = Get-ChildItem -Path "installer/bin/Release" -Filter "*.msi" -Recurse | Select-Object -First 1
if (-not $msiPath) {
Write-Error "No MSI file found!"
exit 1
}
$checksumPath = Get-ChildItem -Path "installer/bin/Release" -Filter "*.sha256" -Recurse | Select-Object -First 1
$tagName = "${{ github.event.release.tag_name }}"
Write-Host "Uploading $($msiPath.Name) to release $tagName..."
# Upload MSI file
gh release upload "$tagName" "$($msiPath.FullName)" --clobber
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to upload MSI file"
exit 1
}
Write-Host "✅ Successfully uploaded $($msiPath.Name)"
# Upload checksum file
if ($checksumPath) {
gh release upload "$tagName" "$($checksumPath.FullName)" --clobber
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to upload checksum file"
exit 1
}
Write-Host "✅ Successfully uploaded $($checksumPath.Name)"
}
- name: Summary
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$tagName = "${{ github.event.release.tag_name }}"
$tagVersion = $tagName.TrimStart('v')
$version = $tagVersion -replace '-.*$', ''
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════"
Write-Host "✅ Release workflow completed successfully"
Write-Host "═══════════════════════════════════════════════════════"
Write-Host "📦 Package: Pxp-v$version.msi"
Write-Host "🏷️ Release: $tagName"
Write-Host "🔐 SHA256 checksum included"
Write-Host "📝 Publisher: PPhatDEV"
Write-Host "═══════════════════════════════════════════════════════"
Write-Host ""