From 46866f320fbf2be81f804df5f7d96dfe34521e27 Mon Sep 17 00:00:00 2001 From: Scion Date: Thu, 2 Oct 2025 17:05:58 -0700 Subject: [PATCH] Added msbuild option. --- dotnet/dotnet-pack/action.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dotnet/dotnet-pack/action.yaml b/dotnet/dotnet-pack/action.yaml index b5289f4..9adc2bb 100644 --- a/dotnet/dotnet-pack/action.yaml +++ b/dotnet/dotnet-pack/action.yaml @@ -36,6 +36,10 @@ inputs: description: "Keep the '.symbols.nupkg' artifacts. Default: true" required: false default: "true" + useMSBuild: + description: "Whether or not to use MSBuild instead of dotnet. Default: false" + required: false + default: "false" runs: using: "composite" steps: @@ -55,7 +59,14 @@ runs: #https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/versioning MMP_VERSION="${{ steps.version.outputs.major || 0 }}.${{ steps.version.outputs.minor || 0 }}" - COMMAND="pack \"${{ inputs.project }}\" --output \"${{ inputs.outputDirectory }}\"" + USEMSBUILD="${{ inputs.useMSBuild }}" + if [[ "$USEMSBUILD" == "true" ]]; then + COMMAND="msbuild \"${{ inputs.project }}\" -t:pack" + else + COMMAND="pack \"${{ inputs.project }}\"" + fi + + COMMAND="$COMMAND --output \"${{ inputs.outputDirectory }}\"" CONFIG="${{ inputs.configuration }}" if [[ -n "$CONFIG" ]]; then COMMAND="$COMMAND --configuration \"$CONFIG\"" @@ -66,7 +77,7 @@ runs: fi VERSION="${{ inputs.version }}" if [[ -n "$VERSION" ]]; then - COMMAND="$COMMAND -p:Version=$VERSION -p:AssemblyVersion=$MM_VERSION" + COMMAND="$COMMAND -p:Version=$VERSION -p:AssemblyVersion=$MMP_VERSION" fi BRANCH="${{ inputs.repositoryBranch }}" if [[ -n "$BRANCH" ]]; then