76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
name: Pulsar .NET 9.0 Windows Release
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
repository-projects: write
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
|
|
- name: Setup .NET 9.0
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '9.0.x'
|
|
|
|
- name: Setup MSBuild
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Get Version
|
|
run: |
|
|
$version = (Get-Content Pulsar.Server/Utilities/ServerVersion.cs | Select-String 'Current = "([^"]+)"').Matches.Groups[1].Value
|
|
echo "VERSION=$version" >> $env:GITHUB_ENV
|
|
shell: pwsh
|
|
|
|
- name: Restore Dependencies
|
|
run: dotnet restore Pulsar.sln
|
|
|
|
- name: Build Solution
|
|
run: msbuild Pulsar.sln /p:Configuration=Release /p:Platform=AnyCPU
|
|
|
|
- name: Prepare Build Output
|
|
run: |
|
|
if (Test-Path "./bin/Release/net9.0-windows") {
|
|
Compress-Archive -Path "./bin/Release/net9.0-windows/*" -DestinationPath "pulsar-net-win64-${{ env.VERSION }}.zip"
|
|
Write-Host "Zipped net9.0-windows output"
|
|
} else {
|
|
Write-Host "Error: net9.0-windows output not found"
|
|
exit 1
|
|
}
|
|
shell: pwsh
|
|
|
|
- name: Upload Build Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-build-${{ env.VERSION }}
|
|
path: pulsar-net-win64-${{ env.VERSION }}.zip
|
|
|
|
- name: Delete existing release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release delete Pulsar-v${{ env.VERSION }} --yes --cleanup-tag || echo "No existing release/tag to delete"
|
|
shell: bash
|
|
|
|
- name: Create Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create Pulsar-v${{ env.VERSION }} pulsar-net-win64-${{ env.VERSION }}.zip \
|
|
-t "Pulsar-v${{ env.VERSION }}" \
|
|
-n "Automated build release for Pulsar v${{ env.VERSION }}" \
|
|
--draft=false \
|
|
--prerelease=false
|
|
shell: bash
|