From 8199402ec1ef8d63499fd6d11b581dd2220d2826 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 11 Sep 2024 16:21:49 -0700 Subject: [PATCH] Build pipeline updates (#475) --- .github/workflows/publish.yml | 57 +++++++++++++++++++++++ build/DirectXTK-GitHub-CMake-Dev17.yml | 23 +-------- build/DirectXTK-GitHub-CMake.yml | 23 +-------- build/DirectXTK-GitHub-Dev17.yml | 2 + build/DirectXTK-GitHub-GDK-Dev17.yml | 8 ++-- build/DirectXTK-GitHub-GDK.yml | 8 ++-- build/DirectXTK-GitHub-SDK-prerelease.yml | 17 +++---- build/DirectXTK-GitHub-SDK-release.yml | 17 +++---- build/DirectXTK-GitHub-Test-Dev17.yml | 2 + build/DirectXTK-GitHub-Test.yml | 2 + build/DirectXTK-GitHub.yml | 2 + build/DirectXTK-SDL.yml | 2 + 12 files changed, 95 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..fe182ef4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,57 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248929 + +name: 'Publish to NuGet.org' + +on: + workflow_dispatch: + inputs: + enablepublish: + description: "Publish to nuget.org" + default: "on" + +permissions: + contents: read + +env: + DESKTOP_NUGET: directxtk_desktop_2019 + WIN10_NUGET: directxtk_desktop_win10 + UWP_NUGET: directxtk_uwp + +jobs: + deploy: + runs-on: windows-latest + environment: production + steps: + - uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2 + + - name: 'Fetch XAudio2Redist from NuGet.org' + run: nuget install Microsoft.XAudio2.Redist -Source https://api.nuget.org/v3/index.json -OutputDirectory ${{ github.workspace }} + + - name: 'Fetch NuGet package 1 from Release view' + run: nuget install ${{ env.DESKTOP_NUGET }} -Source %URL% -OutputDirectory ${{ github.workspace }} + env: + URL: ${{ vars.ADO_FEED_URL }} + + - name: 'Fetch NuGet package 2 from Release view' + run: nuget install ${{ env.WIN10_NUGET }} -Source %URL% -OutputDirectory ${{ github.workspace }} + env: + URL: ${{ vars.ADO_FEED_URL }} + + - name: 'Fetch NuGet package 3 from Release view' + run: nuget install ${{ env.UWP_NUGET }} -Source %URL% -OutputDirectory ${{ github.workspace }} + env: + URL: ${{ vars.ADO_FEED_URL }} + + - name: 'Verify NuGet packages' + working-directory: ${{ github.workspace }} + run: for /R %1 in (directxtk*.nupkg) do nuget verify -All -Signatures -Verbosity quiet %1 + + - if: github.event.inputs.enablepublish == 'on' + name: 'Publish NuGet packages' + working-directory: ${{ github.workspace }} + run: for /R %1 in (directxtk*.nupkg) do nuget push %1 -Source https://api.nuget.org/v3/index.json -ApiKey %APIKEY% -SkipDuplicate + env: + APIKEY: ${{ secrets.NUGET_APIKEY }} diff --git a/build/DirectXTK-GitHub-CMake-Dev17.yml b/build/DirectXTK-GitHub-CMake-Dev17.yml index c0125852..bab5b276 100644 --- a/build/DirectXTK-GitHub-CMake-Dev17.yml +++ b/build/DirectXTK-GitHub-CMake-Dev17.yml @@ -56,7 +56,6 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) variables: Codeql.Enabled: false VS_GENERATOR: 'Visual Studio 17 2022' - REDIST_DIR: $(xaudio2redist_DIR) WIN10_SDK: '10.0.19041.0' WIN11_SDK: '10.0.22000.0' @@ -160,27 +159,7 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out8 -v - - task: NuGetToolInstaller@1 - displayName: 'Use NuGet' - enabled: False - - task: NuGetCommand@2 - displayName: Install Microsoft.XAudio2.Redist - enabled: False - inputs: - command: custom - arguments: install Microsoft.XAudio2.Redist -ExcludeVersion -OutputDirectory $(REDIST_DIR) - - task: CMake@1 - displayName: 'CMake (ClangCl Win7): Config' - enabled: False - inputs: - cwd: '$(Build.SourcesDirectory)' - cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out9 -DBUILD_XAUDIO_WIN7=ON -DBUILD_XAUDIO_WIN8=OFF -DBUILD_TOOLS=OFF -Dxaudio2redist_DIR=$(REDIST_DIR)\Microsoft.XAudio2.Redist' - - task: CMake@1 - displayName: 'CMake (Build Win7): Build' - enabled: False - inputs: - cwd: '$(Build.SourcesDirectory)' - cmakeArgs: --build out9 -v + # removed out9 case - task: CMake@1 displayName: 'CMake (MSVC Spectre): Config x64' inputs: diff --git a/build/DirectXTK-GitHub-CMake.yml b/build/DirectXTK-GitHub-CMake.yml index 3cba81f6..3d0e3088 100644 --- a/build/DirectXTK-GitHub-CMake.yml +++ b/build/DirectXTK-GitHub-CMake.yml @@ -56,7 +56,6 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) variables: Codeql.Enabled: false VS_GENERATOR: 'Visual Studio 16 2019' - REDIST_DIR: $(xaudio2redist_DIR) WIN10_SDK: '10.0.19041.0' WIN11_SDK: '10.0.22000.0' @@ -160,27 +159,7 @@ jobs: inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out8 -v - - task: NuGetToolInstaller@1 - displayName: 'Use NuGet' - enabled: False - - task: NuGetCommand@2 - displayName: Install Microsoft.XAudio2.Redist - enabled: False - inputs: - command: custom - arguments: install Microsoft.XAudio2.Redist -ExcludeVersion -OutputDirectory $(REDIST_DIR) - - task: CMake@1 - displayName: 'CMake (ClangCl Win7): Config' - enabled: False - inputs: - cwd: '$(Build.SourcesDirectory)' - cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out9 -DBUILD_XAUDIO_WIN7=ON -DBUILD_XAUDIO_WIN8=OFF -DBUILD_TOOLS=OFF -Dxaudio2redist_DIR=$(REDIST_DIR)\Microsoft.XAudio2.Redist' - - task: CMake@1 - displayName: 'CMake (Build Win7): Build' - enabled: False - inputs: - cwd: '$(Build.SourcesDirectory)' - cmakeArgs: --build out9 -v + # removed out9 case - task: CMake@1 displayName: 'CMake (MSVC Spectre): Config x64' inputs: diff --git a/build/DirectXTK-GitHub-Dev17.yml b/build/DirectXTK-GitHub-Dev17.yml index 677def66..c7ffe901 100644 --- a/build/DirectXTK-GitHub-Dev17.yml +++ b/build/DirectXTK-GitHub-Dev17.yml @@ -49,6 +49,8 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet restore inputs: diff --git a/build/DirectXTK-GitHub-GDK-Dev17.yml b/build/DirectXTK-GitHub-GDK-Dev17.yml index 682a2c47..f2e71f03 100644 --- a/build/DirectXTK-GitHub-GDK-Dev17.yml +++ b/build/DirectXTK-GitHub-GDK-Dev17.yml @@ -59,8 +59,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -84,6 +82,8 @@ jobs: arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet install PGDK inputs: @@ -130,8 +130,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -155,6 +153,8 @@ jobs: arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet install PGDK inputs: diff --git a/build/DirectXTK-GitHub-GDK.yml b/build/DirectXTK-GitHub-GDK.yml index b21e1c31..d53ac888 100644 --- a/build/DirectXTK-GitHub-GDK.yml +++ b/build/DirectXTK-GitHub-GDK.yml @@ -80,8 +80,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -105,6 +103,8 @@ jobs: arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet install PGDK inputs: @@ -155,8 +155,6 @@ jobs: failOnStderr: true - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -179,6 +177,8 @@ jobs: arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet install PGDK inputs: diff --git a/build/DirectXTK-GitHub-SDK-prerelease.yml b/build/DirectXTK-GitHub-SDK-prerelease.yml index f7db5693..18c298bb 100644 --- a/build/DirectXTK-GitHub-SDK-prerelease.yml +++ b/build/DirectXTK-GitHub-SDK-prerelease.yml @@ -45,8 +45,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -70,6 +68,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK x64 inputs: @@ -226,8 +226,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -250,6 +248,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK x64 inputs: @@ -295,16 +295,15 @@ jobs: platform: x64 configuration: Release -- job: UWP_BUILD_ARM_ARM64 - displayName: 'Universal Windows Platform (UWP) for ARM/ARM64' +- job: UWP_BUILD_ARM64 + displayName: 'Universal Windows Platform (UWP) for ARM64' + # Windows on ARM 32-bit is deprecated. https://learn.microsoft.com/windows/arm/arm32-to-arm64 steps: - checkout: self clean: true fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -327,6 +326,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK arm64 inputs: diff --git a/build/DirectXTK-GitHub-SDK-release.yml b/build/DirectXTK-GitHub-SDK-release.yml index acf15c4e..7e615859 100644 --- a/build/DirectXTK-GitHub-SDK-release.yml +++ b/build/DirectXTK-GitHub-SDK-release.yml @@ -45,8 +45,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -70,6 +68,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK x64 inputs: @@ -226,8 +226,6 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -250,6 +248,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK x64 inputs: @@ -295,16 +295,15 @@ jobs: platform: x64 configuration: Release -- job: UWP_BUILD_ARM_ARM64 - displayName: 'Universal Windows Platform (UWP) for ARM/ARM64' +- job: UWP_BUILD_ARM64 + displayName: 'Universal Windows Platform (UWP) for ARM64' + # Windows on ARM 32-bit is deprecated. https://learn.microsoft.com/windows/arm/arm32-to-arm64 steps: - checkout: self clean: true fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' - inputs: - versionSpec: '6.5.x' - task: PowerShell@2 displayName: 'Create nuget.config with single source' inputs: @@ -327,6 +326,8 @@ jobs: arguments: sources add -Name xboxgdk-DirectXTK -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet Install WSDK arm64 inputs: diff --git a/build/DirectXTK-GitHub-Test-Dev17.yml b/build/DirectXTK-GitHub-Test-Dev17.yml index 7296cf87..27bf3f93 100644 --- a/build/DirectXTK-GitHub-Test-Dev17.yml +++ b/build/DirectXTK-GitHub-Test-Dev17.yml @@ -185,6 +185,8 @@ jobs: failOnStderr: true - task: NuGetToolInstaller@1 displayName: 'Use NuGet' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet restore inputs: diff --git a/build/DirectXTK-GitHub-Test.yml b/build/DirectXTK-GitHub-Test.yml index 4572ec73..38d49b70 100644 --- a/build/DirectXTK-GitHub-Test.yml +++ b/build/DirectXTK-GitHub-Test.yml @@ -169,6 +169,8 @@ jobs: failOnStderr: true - task: NuGetToolInstaller@1 displayName: 'Use NuGet' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet restore inputs: diff --git a/build/DirectXTK-GitHub.yml b/build/DirectXTK-GitHub.yml index 6ca2e5b5..c2ccbdd1 100644 --- a/build/DirectXTK-GitHub.yml +++ b/build/DirectXTK-GitHub.yml @@ -49,6 +49,8 @@ jobs: fetchTags: false - task: NuGetToolInstaller@1 displayName: 'Use NuGet' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NuGetCommand@2 displayName: NuGet restore inputs: diff --git a/build/DirectXTK-SDL.yml b/build/DirectXTK-SDL.yml index eb5c1cc3..70b313cc 100644 --- a/build/DirectXTK-SDL.yml +++ b/build/DirectXTK-SDL.yml @@ -73,6 +73,8 @@ jobs: arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config - task: nuget-security-analysis@0 displayName: 'Secure Supply Chain Analysis' + - task: NuGetAuthenticate@1 + displayName: 'NuGet Auth' - task: NodeTool@0 displayName: 'NPM install' inputs: