Uploaded many more actions.
This commit is contained in:
88
dotnet/dotnet-pack/action.yaml
Normal file
88
dotnet/dotnet-pack/action.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
# Reference: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack
|
||||
name: dotnet-pack
|
||||
description: "Pack a .sln or .csproj file into a .nupkg."
|
||||
inputs:
|
||||
project:
|
||||
description: "The .sln or .csproj project to pack."
|
||||
required: true
|
||||
default: .
|
||||
id:
|
||||
description: "The id of the package. Defaults to the AssemblyName."
|
||||
required: false
|
||||
default: ""
|
||||
version:
|
||||
description: "Version of the .nupkg file."
|
||||
required: false
|
||||
default: ""
|
||||
outputDirectory:
|
||||
description: "Directory for the output file."
|
||||
required: true
|
||||
repositoryBranch:
|
||||
description: "The repository branch of the package."
|
||||
required: false
|
||||
default: ${{ github.ref_name }}
|
||||
deterministic:
|
||||
description: "Whether or not the build should be deterministic. Default: true"
|
||||
required: false
|
||||
default: "true"
|
||||
configuration:
|
||||
description: "The build configuration to use. Default: Release"
|
||||
required: false
|
||||
default: "Release"
|
||||
additionalArgs:
|
||||
description: "Additional arguments to use when packing project."
|
||||
required: false
|
||||
keepSymbols:
|
||||
description: "Keep the '.symbols.nupkg' artifacts. Default: true"
|
||||
required: false
|
||||
default: "true"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Parse the version."
|
||||
id: version
|
||||
uses: act/common/utils/version-parse@master
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
- name: "Build the pack command."
|
||||
id: command
|
||||
run: |
|
||||
#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 }}\""
|
||||
CONFIG="${{ inputs.configuration }}"
|
||||
if [[ -n "$CONFIG" ]]; then
|
||||
COMMAND="$COMMAND --configuration \"$CONFIG\""
|
||||
fi
|
||||
ID="${{ inputs.id }}"
|
||||
if [[ -n "$ID" ]]; then
|
||||
COMMAND="$COMMAND -p:PackageId=$ID"
|
||||
fi
|
||||
VERSION="${{ inputs.version }}"
|
||||
if [[ -n "$VERSION" ]]; then
|
||||
COMMAND="$COMMAND -p:Version=$VERSION -p:AssemblyVersion=$MM_VERSION"
|
||||
fi
|
||||
BRANCH="${{ inputs.repositoryBranch }}"
|
||||
if [[ -n "$BRANCH" ]]; then
|
||||
COMMAND="$COMMAND -p:RepositoryBranch=$BRANCH"
|
||||
fi
|
||||
DETERMINISTIC="${{ inputs.deterministic }}"
|
||||
if [[ "$DETERMINISTIC" == "true" ]]; then
|
||||
COMMAND="$COMMAND -p:ContinuousIntegrationBuild=$DETERMINISTIC"
|
||||
fi
|
||||
echo "command=$COMMAND ${{ inputs.additionalArgs }}" >> "$GITHUB_OUTPUT"
|
||||
shell: bash
|
||||
- name: "Build the .nupkg file."
|
||||
uses: act/common/dotnet/dotnet-6@master
|
||||
with:
|
||||
command: ${{ steps.command.outputs.command }}
|
||||
- name: "Own artifacts."
|
||||
uses: act/common/utils/chown@master
|
||||
with:
|
||||
file: ${{ inputs.outputDirectory }}
|
||||
- name: "Remove symbols."
|
||||
if: ${{ inputs.keepSymbols == 'false' }}
|
||||
run: |
|
||||
rm -rf "${{ inputs.outputDirectory }}"/*.symbols.nupkg
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user