Added a Font Converter and align Font, FontFamily to System.Drawing interface #58
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: Build & Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
force-dev-push: | |
description: 'Force publication of NuGet package of a developer version to an internal feed for test purpose' | |
required: false | |
default: 'false' | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
Configuration: Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 7.0.x | |
- name: Set Build Variables | |
id: buildVariables | |
run: | | |
$VersionTag = '' | |
$doPush = $true | |
switch -regex ($Env:GITHUB_REF_NAME) { | |
'^main' { | |
#$PUBLISH_TO_NUGETORG = 'true' | |
#--- | |
# Temporary publish to an internal feed with prerelease tag 'trunk' | |
# while we are working in the first release | |
$PUBLISH_TO_NUGETORG = 'false' | |
$VersionTag = 'trunk' | |
#--- | |
} | |
default { | |
$PUBLISH_TO_NUGETORG = 'false' | |
$VersionTag = "dev" | |
if ([string]::IsNullOrEmpty("${{ github.event.inputs.force-dev-push }}") ) { | |
$doPush = $false | |
} else { | |
$doPush = [System.Convert]::ToBoolean("${{ github.event.inputs.force-dev-push }}") | |
} | |
} | |
} | |
$NuGetPackageVersion = dotnet msbuild Directory.Build.props /t:GetPackageVersion | |
"$NuGetPackageVersion" -match "(?<=NuGetPackageVersion:)(.*)" | |
$NuGetPackageVersion = $Matches[0] | |
if ($VersionTag -ne '') { | |
$Timestamp = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss") | |
$NuGetPackageVersion = $NuGetPackageVersion + "-" + $VersionTag + "." + $Timestamp | |
} | |
echo "NuGetPackageVersion=$NuGetPackageVersion" >> $Env:GITHUB_ENV | |
echo "IS_PUBLISH_TO_NUGETORG=$PUBLISH_TO_NUGETORG" >> $Env:GITHUB_ENV | |
echo "DO_PACKAGE_PUSH=$doPush" >> $Env:GITHUB_ENV | |
write-host [INFO] NuGet Package Version: $NuGetPackageVersion | |
- name: Build & Pack | |
run: dotnet build --configuration $env:Configuration -p:Version=$Env:NuGetPackageVersion | |
- name: Test | |
run: dotnet test --configuration $env:Configuration --no-build | |
- name: Sign packages | |
if: env.IS_PUBLISH_TO_NUGETORG == 'true' | |
env: | |
TIMESTAMPER_URL: ${{ secrets.CODE_SIGN_CERTIFICATE_TIMESTAMPER_URL }} | |
PFX_BASE64: ${{ secrets.CODE_SIGN_CERTIFICATE_BASE64 }} | |
PFX_PASS: ${{ secrets.CODE_SIGN_CERTIFICATE_PASSWORD }} | |
run: | | |
$codesign_pfx = "code_sign_cert.pfx" | |
$bytes = [Convert]::FromBase64String($Env:PFX_BASE64) | |
[IO.File]::WriteAllBytes($codesign_pfx, $bytes) | |
Get-ChildItem .\_packages\$Env:Configuration\*.nupkg -Recurse | | |
dotnet nuget sign $_.FullName --certificate-path $codesign_pfx --certificate-password $Env:PFX_PASS --timestamper $Env:TIMESTAMPER_URL | |
} | |
- name: Publish | |
if: env.DO_PACKAGE_PUSH == 'true' | |
run: | | |
if ( ${{ env.IS_PUBLISH_TO_NUGETORG }} ) { | |
dotnet nuget add source ${{ vars.NUGET_ORG_FEED }} --name NuGetFeed4Deploy --username gxbuilder --password ${{ secrets.NUGET_ORG_TOKEN }} | |
} else { | |
dotnet nuget add source ${{ vars.AZURE_NEXUS_PRERELEASES_FEED }} --name NuGetFeed4Deploy --username gxbuilder --password ${{ secrets.AZURE_ARTIFACTS_TOKEN }} | |
} | |
Get-ChildItem .\_packages\$Env:Configuration\*.nupkg -Recurse | | |
ForEach-Object { | |
dotnet nuget push $_.FullName --source NuGetFeed4Deploy --api-key DUMMY-KEY | |
} |