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

View File

@@ -0,0 +1,49 @@
name: ikdasm-files
description: "Run ikdasm to disassemble .NET assemblies in a folder."
inputs:
directory:
description: "Directory to search."
required: true
default: '.'
pattern:
description: "Pattern of files to search for."
required: true
default: '*.dll'
extension:
description: "Extension of the disassembly files. Default: .dasm"
required: true
default: '.dasm'
deleteAssemblies:
description: "Whether or not the assemblies should be deleted afterwards."
required: false
default: "false"
removeComments:
description: "Whether or not the lines starting with // should be removed from the disassembled files."
required: false
default: "false"
catchErrors:
description: "Whether or not errors should be handled."
required: false
outputs:
console:
description: "The console output of the command."
value: ${{ steps.ikdasm.outputs.console }}
runs:
using: 'composite'
steps:
- name: "Make temporary file of script."
id: script
uses: act/common/utils/mktemp@master
with:
input: ${{ github.action_path }}/disassemble_files.sh
tmpDir: .
- name: "Run ikdasm script."
id: ikdasm
uses: act/common/mono/mono@master
env:
DASM_EXTENSION: ${{ inputs.extension }}
with:
program: bash
command: ${{ steps.script.outputs.tmp }} "${{ inputs.directory }}" "${{ inputs.pattern }}" ${{ inputs.deleteAssemblies }} ${{ inputs.removeComments }}
catchErrors: ${{ inputs.catchErrors }}

View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Get the directory and pattern as arguments
DIR=$1
PATTERN=$2
REMOVE_ORIGINAL=$3
REMOVE_COMMENTS=$4
DASM_EXTENSION=${DASM_EXTENSION:-".dasm"}
find "$DIR" -type f -name "$PATTERN" -print0 | while IFS= read -r -d '' file; do
# Disassemble the file and save it to a temporary file.
OUTFILE="${file}${DASM_EXTENSION}"
TMP=$(mktemp)
ikdasm "$file" > "$TMP"
if [[ "$REMOVE_COMMENTS" == "true" ]]; then
# Remove lines starting with //
sed -i '/^\/\//d' "$TMP"
fi
# Move the temporary file to the output file.
mv "$TMP" "$OUTFILE"
echo $(basename "$OUTFILE")
if [[ "$REMOVE_ORIGINAL" == "true" ]]; then
rm "$file"
fi
done

20
mono/mono/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM debian:stable-slim
ENV NUGET_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/$NUGET_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"]

24
mono/mono/action.yaml Normal file
View File

@@ -0,0 +1,24 @@
name: mono
description: "Run mono commands."
inputs:
command:
description: "Shell arguments to pass into mono."
required: true
program:
description: "Program to run instead of mono. Default: mono"
required: false
default: "mono"
catchErrors:
description: "Whether or not errors should be handled."
required: false
outputs:
console:
description: "The console output of the command."
runs:
env:
PROGRAM: ${{ inputs.program }}
CATCH_ERRORS: ${{ inputs.catchErrors }}
using: docker
image: Dockerfile
args:
- ${{ inputs.command }}

20
mono/mono/entrypoint.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
COMMAND="$@"
PROGRAM=${PROGRAM:-"mono"}
OUTPUT=$(bash -c "$PROGRAM $COMMAND")
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