Build and publish AutoDiscovery in this repository too #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Redpoint.AutoDiscovery | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
UET_FRAMEWORK_TARGET: net8.0 | |
UET_BUILDING_ON_BUILD_SERVER: "true" | |
jobs: | |
autodiscovery: | |
name: "Build and Publish" | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET SDK | |
uses: ./.github/actions/dotnet-sdk | |
with: | |
UET_FRAMEWORK_TARGET: ${{ env.UET_FRAMEWORK_TARGET }} | |
- name: Build Redpoint.AutoDiscovery | |
shell: pwsh | |
run: | | |
$Timestamp = ([DateTime]::UtcNow) | |
$PackageVersion = "$($Timestamp.Year).$($Timestamp.DayOfYear + 1000).$(($Timestamp.Hour * 60) + $Timestamp.Minute)" | |
Write-Host "Package version: $PackageVersion" | |
Write-Host "Building Redpoint.AutoDiscovery version '$PackageVersion'..." | |
dotnet ` | |
msbuild ` | |
-restore ` | |
-p:RuntimeIdentifier=win-x86 ` | |
-p:Configuration=Debug ` | |
-p:Platform=x86 ` | |
"-p:BaseUetVersion=$PackageVersion" ` | |
"-p:PackageVersion=$PackageVersion" ` | |
Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj | |
if ($LastExitCode -ne 0) { exit $LastExitCode } | |
dotnet ` | |
msbuild ` | |
-restore ` | |
-p:RuntimeIdentifier=win-x86 ` | |
-p:Configuration=Release ` | |
-p:Platform=x86 ` | |
"-p:BaseUetVersion=$PackageVersion" ` | |
"-p:PackageVersion=$PackageVersion" ` | |
Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj | |
if ($LastExitCode -ne 0) { exit $LastExitCode } | |
dotnet ` | |
msbuild ` | |
-restore ` | |
-p:RuntimeIdentifier=win-x64 ` | |
-p:Configuration=Debug ` | |
-p:Platform=x64 ` | |
"-p:BaseUetVersion=$PackageVersion" ` | |
"-p:PackageVersion=$PackageVersion" ` | |
Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj | |
if ($LastExitCode -ne 0) { exit $LastExitCode } | |
dotnet ` | |
msbuild ` | |
-restore ` | |
-p:RuntimeIdentifier=win-x64 ` | |
-p:Configuration=Release ` | |
-p:Platform=x64 ` | |
"-p:BaseUetVersion=$PackageVersion" ` | |
"-p:PackageVersion=$PackageVersion" ` | |
Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj | |
if ($LastExitCode -ne 0) { exit $LastExitCode } | |
dotnet ` | |
msbuild ` | |
-restore ` | |
-t:Publish ` | |
-p:Configuration=Release ` | |
-p:Platform=AnyCPU ` | |
-p:UsePrebuiltLibsForAutoDiscovery=true ` | |
"-p:BaseUetVersion=$PackageVersion" ` | |
"-p:PackageVersion=$PackageVersion" ` | |
Redpoint.AutoDiscovery/Redpoint.AutoDiscovery.csproj | |
if ($LastExitCode -ne 0) { exit $LastExitCode } | |
- name: Publish Redpoint.AutoDiscovery | |
shell: pwsh | |
if: github.ref == 'refs/heads/main' | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: | | |
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery/bin/Release/Redpoint.AutoDiscovery.*.nupkg" | % { $_.FullName }) | |
if ($LastExitCode -ne 0) { exit $LastExitCode } |