From 0f49072f0b88fc9be762bd7ea0cfc205ef273d54 Mon Sep 17 00:00:00 2001 From: Brad Bayliss <919214+Bradez@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:32:58 +0000 Subject: [PATCH] [PLA-2188] Uploads NuGet Packages to Release Tag Signed-off-by: Brad Bayliss <919214+Bradez@users.noreply.github.com> --- .../workflows/{Build & Test.yml => build.yml} | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) rename .github/workflows/{Build & Test.yml => build.yml} (50%) diff --git a/.github/workflows/Build & Test.yml b/.github/workflows/build.yml similarity index 50% rename from .github/workflows/Build & Test.yml rename to .github/workflows/build.yml index 0ae0289..63fe6d0 100644 --- a/.github/workflows/Build & Test.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,18 @@ -name: Build & Test +name: Build, Test & Package on: push: branches: - master + tags: + - '*' pull_request: -permissions: read-all +permissions: + contents: write jobs: - build-and-test: + build: runs-on: windows-latest steps: - name: Checkout @@ -27,8 +30,7 @@ jobs: uses: darenm/Setup-VSTest@v1 - name: Navigate to Solution Folder - run: | - cd $GITHUB_WORKSPACE + run: cd $GITHUB_WORKSPACE - name: Cache NuGet Packages uses: actions/cache@v3 @@ -39,13 +41,21 @@ jobs: ${{ runner.os }}-nuget- - name: Restore Packages - run: | - nuget restore ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.sln + run: nuget restore ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.sln - name: Build Solution - run: | - msbuild.exe ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.sln /p:platform="Any CPU" /p:configuration="Release" + run: msbuild.exe ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.sln /p:platform="Any CPU" /p:configuration="Release" - name: Run Tests + run: vstest.console.exe ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/bin/Release/net6.0/Enjin.Platform.Sdk.Tests.dll + + - name: Build NuGet Packages run: | - vstest.console.exe ./src/Enjin.Platform.Sdk/Enjin.Platform.Sdk.Tests/bin/Release/net6.0/Enjin.Platform.Sdk.Tests.dll + cd ./src/Enjin.Platform.Sdk + dotnet pack --configuration Release --output ./nuget-packages/ + + - name: Upload Artifcats + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./src/Enjin.Platform.Sdk/nuget-packages/*.nupkg