Uploaded many more actions.
This commit is contained in:
101
dotnet/dotnet-pack-and-compare/action.yaml
Normal file
101
dotnet/dotnet-pack-and-compare/action.yaml
Normal file
@@ -0,0 +1,101 @@
|
||||
name: nuget-pack-and-compare
|
||||
description: "Pack a .sln or .csproj file into a .nupkg."
|
||||
inputs:
|
||||
name:
|
||||
description: "The name of the package."
|
||||
required: true
|
||||
project:
|
||||
description: "The .sln or .csproj project to pack."
|
||||
required: 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"
|
||||
defaultVersion:
|
||||
description: "Version of the .nupkg file."
|
||||
required: true
|
||||
default: 1.0.0
|
||||
outputDirectory:
|
||||
description: "Directory for the output .nupkg."
|
||||
required: true
|
||||
default: "out"
|
||||
url:
|
||||
description: "Url of the GitHub server instance."
|
||||
required: true
|
||||
default: ${{ github.server_url }}
|
||||
organization:
|
||||
description: "Organization to search."
|
||||
required: true
|
||||
default: ${{ github.repository_owner }}
|
||||
username:
|
||||
description: "Username for the nuget repository to search."
|
||||
required: true
|
||||
default: ${{ github.actor }}
|
||||
password:
|
||||
description: "Password or ApiKey of the nuget repository to search."
|
||||
required: true
|
||||
default: ${{ github.token }}
|
||||
outputs:
|
||||
nupkg:
|
||||
description: "The generated output .nupkg file."
|
||||
value: ${{ steps.package.outputs.nupkg }}
|
||||
nupkgName:
|
||||
description: "The generated output .nupkg file's name."
|
||||
value: ${{ steps.package.outputs.nupkgName }}
|
||||
hasChanged:
|
||||
description: "Whether or not the .nupkg files match."
|
||||
value: ${{ steps.compare.outputs.success != 'true' }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Own workspace."
|
||||
uses: act/common/utils/chown@master
|
||||
- name: "Get the next version of the package."
|
||||
uses: act/common/nuget/nuget-get-next-branched-version@master
|
||||
id: nuget
|
||||
with:
|
||||
name: ${{ inputs.name }}
|
||||
defaultVersion: ${{ inputs.defaultVersion }}
|
||||
url: ${{ inputs.url }}
|
||||
organization: ${{ inputs.organization }}
|
||||
apiToken: ${{ inputs.password }}
|
||||
- name: "Build .nupkg."
|
||||
uses: act/common/dotnet/dotnet-pack@master
|
||||
with:
|
||||
project: ${{ inputs.project || inputs.name }}
|
||||
id: ${{ inputs.name }}
|
||||
version: ${{ steps.nuget.outputs.nextVersion }}
|
||||
configuration: ${{ inputs.configuration }}
|
||||
outputDirectory: ${{ inputs.outputDirectory }}
|
||||
keepSymbols: ${{ inputs.keepSymbols }}
|
||||
additionalArgs: ${{ inputs.additionalArgs }}
|
||||
- name: "Generate package outputs."
|
||||
id: package
|
||||
run: |
|
||||
NUPKG_EXT=".nupkg"
|
||||
if [ "${{ inputs.keepSymbols }}" == "true" ]; then
|
||||
NUPKG_EXT=".symbols$NUPKG_EXT"
|
||||
fi
|
||||
NUPKG_NAME="${{ inputs.name }}.${{ steps.nuget.outputs.nextVersion }}$NUPKG_EXT"
|
||||
NUPKG_PATH="${{ inputs.outputDirectory }}/$NUPKG_NAME"
|
||||
echo "nupkg=$NUPKG_PATH" >> "$GITHUB_OUTPUT"
|
||||
echo "nupkgName=$NUPKG_NAME" >> "$GITHUB_OUTPUT"
|
||||
shell: bash
|
||||
- name: "Compare .nupkg to remote .nupkg."
|
||||
if: ${{ steps.nuget.outputs.latestVersion }}
|
||||
id: compare
|
||||
uses: act/common/nuget/nuget-compare-version@master
|
||||
with:
|
||||
lhs: ${{ steps.package.outputs.nupkg }}
|
||||
version: ${{ steps.nuget.outputs.latestVersion }}
|
||||
name: ${{ inputs.name }}
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
url: ${{ inputs.url }}/_registry/nuget/${{ inputs.organization }}/index.json
|
||||
Reference in New Issue
Block a user