Added many, many more actions.

This commit is contained in:
2025-06-24 15:24:16 -07:00
parent 62fbe4dead
commit 57ef232d2b
108 changed files with 4212 additions and 7 deletions

20
nuget/nuget/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM debian:stable-slim
ENV VERSION=v6.5.0
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
bash \
wget \
mono-complete \
tzdata
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
RUN wget https://dist.nuget.org/win-x86-commandline/$VERSION/nuget.exe -O /usr/bin/nuget.exe
RUN chmod +x /usr/bin/nuget.exe
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

39
nuget/nuget/action.yaml Normal file
View File

@@ -0,0 +1,39 @@
name: nuget
description: "Run a nuget command."
inputs:
command:
description: "Nuget command to run."
required: false
catchErrors:
description: "Whether or not errors should be handled."
required: false
source:
description: "Name of the source to use."
required: false
default: origin
url:
description: "Url of the NuGet repository."
required: false
default: ${{ github.server_url }}/_registry/nuget/${{ github.repository_owner }}/index.json
username:
description: "Username for the nuget repository to search."
required: false
default: ${{ github.actor }}
password:
description: "Password or ApiKey of the nuget repository to search."
required: false
default: ${{ github.token }}
outputs:
console:
description: "The console output of the command."
runs:
using: 'docker'
image: 'Dockerfile'
env:
NUGET_SOURCE_NAME: ${{ inputs.source }}
NUGET_SOURCE_URL: ${{ inputs.url }}
NUGET_SOURCE_USERNAME: ${{ inputs.username }}
NUGET_SOURCE_PASSWORD: ${{ inputs.password }}
CATCH_ERRORS: ${{ inputs.catchErrors }}
args:
- ${{ inputs.command }}

32
nuget/nuget/entrypoint.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
#TODO: Reweite this action to make use of act/common/mono/mono
function nuget
{
mono /usr/bin/nuget.exe $@
}
if [[ -n "$NUGET_SOURCE_NAME" && -n "$NUGET_SOURCE_URL" && -n "$NUGET_SOURCE_USERNAME" && -n "$NUGET_SOURCE_PASSWORD" ]]; then
nuget source remove -Name "$NUGET_SOURCE_NAME"
nuget source add -Name "$NUGET_SOURCE_NAME" -Source "$NUGET_SOURCE_URL" -Username "$NUGET_SOURCE_USERNAME" -Password "$NUGET_SOURCE_PASSWORD"
SET_SOURCE=true
fi
OUTPUT=$(bash -c "mono /usr/bin/nuget.exe $@")
RESULT=$?
echo "$OUTPUT"
#Output multiline strings.
#https://trstringer.com/github-actions-multiline-strings/
if [[ -n "$OUTPUT" ]]; then
echo "console<<EOF" >> "$GITHUB_OUTPUT"
echo "$OUTPUT" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
fi
if [[ -n "$SET_SOURCE" ]]; then
nuget source remove -Name "$NUGET_SOURCE_NAME"
fi
if [[ "$CATCH_ERRORS" != "true" ]]; then
exit $RESULT
fi