Test
This commit is contained in:
14
dotnet/dotnet-10/Dockerfile
Normal file
14
dotnet/dotnet-10/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
ARG VERSION=10.0.100-preview.5
|
||||
FROM mcr.microsoft.com/dotnet/sdk:$VERSION
|
||||
|
||||
RUN apt update
|
||||
RUN apt install curl -y
|
||||
|
||||
# Add tools to Path.
|
||||
RUN echo 'export PATH="$PATH:$HOME/.dotnet/tools/"' | tee -a "$HOME/.bashrc" > /dev/null
|
||||
# Install NugetForUnity tool: https://github.com/GlitchEnzo/NuGetForUnity
|
||||
RUN dotnet tool install --global NuGetForUnity.Cli
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
21
dotnet/dotnet-10/action.yaml
Normal file
21
dotnet/dotnet-10/action.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
name: dotnet-10
|
||||
description: "Run a dotnet command."
|
||||
inputs:
|
||||
command:
|
||||
description: "Dotnet command to run."
|
||||
required: false
|
||||
program:
|
||||
description: "Program to run instead of dotnet. Default: dotnet"
|
||||
required: false
|
||||
default: "dotnet"
|
||||
catchErrors:
|
||||
description: "Whether or not errors should be handled."
|
||||
required: false
|
||||
runs:
|
||||
env:
|
||||
PROGRAM: ${{ inputs.program }}
|
||||
CATCH_ERRORS: ${{ inputs.catchErrors }}
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.command }}
|
||||
25
dotnet/dotnet-10/entrypoint.sh
Normal file
25
dotnet/dotnet-10/entrypoint.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
COMMAND="$@"
|
||||
set -o pipefail
|
||||
|
||||
# Add root tools to Path.
|
||||
export PATH="$PATH:/root/.dotnet/tools/"
|
||||
|
||||
PROGRAM=${PROGRAM:-"dotnet"}
|
||||
exec 5>&1
|
||||
OUTPUT=$(bash -c "$PROGRAM $COMMAND" | tee /dev/fd/5)
|
||||
RESULT=$?
|
||||
|
||||
#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
|
||||
|
||||
echo "exitCode=$RESULT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "$CATCH_ERRORS" != "true" ]]; then
|
||||
exit $RESULT
|
||||
fi
|
||||
Reference in New Issue
Block a user