Added new upload action.

This commit is contained in:
2025-07-10 21:52:25 -07:00
parent 75995ef4cd
commit 3d72a9d312
2 changed files with 78 additions and 3 deletions

View File

@@ -0,0 +1,75 @@
name: butler-push-previous-artifacts
description: "Upload previous workflow artifacts to butler."
inputs:
workflowPattern:
description: "Pattern of the workflow name to match. Supports wildcard or RegEx. Default: ${{ github.event.repository.workflow }}"
required: true
default: "${{ github.event.repository.workflow }}"
artifactPattern:
description: "Pattern of the artifacts to match. Supports wildcard or RegEx. Default: *"
required: true
default: "*"
password:
description: "Credentials to use for Gitea. If not specified, the GitHub/Gitea token will be used."
required: true
default: "${{ github.token }}"
nugetPasswords:
description: "Credentials to use for NuGet. If not specified, the password will be used."
required: true
default: ""
unzipDir:
description: "Directory to unzip the artifacts into. If not specified, the artifacts will not be unzipped."
required: false
default: ""
unzipPattern:
description: "Pattern of the files to upload from the unzipped artifacts."
required: false
default: ""
account:
description: "Itch.io account name."
required: true
project:
description: "Itch.io project name."
required: true
channel:
description: "Itch.io channel name."
required: true
apiKey:
description: "Itch.io API key."
required: true
version:
description: "The version of the file to upload."
required: true
default: ""
runs:
using: "composite"
steps:
- uses: act/common/gitea/download-previous-artifacts@master
id: download
with:
workflowPattern: ${{ inputs.workflowPattern }}
artifactPattern: ${{ inputs.artifactPattern }}
password: ${{ inputs.password }}
nugetPasswords: ${{ inputs.nugetPasswords || inputs.password }}
unzipDir: ${{ inputs.unzipDir }}
- name: "Get the file to upload."
id: artifacts
run: |
if [[ -n "${{ inputs.unzipDir }}" ]]; then
echo "Using unzipPattern: ${{ inputs.unzipPattern }}"
FIRST_DIR=$(echo '${{ steps.download.outputs.downloadedArtifactDirs }}' | tr ',' '\n' | head -n 1)
echo "file=$(ls -1 ${FIRST_DIR}/*${{ inputs.unzipPattern }} | head -n 1)" >> "$GITHUB_OUTPUT"
else
echo "Using first downloaded artifact path"
echo "file=$(echo '${{ steps.download.outputs.downloadedArtifactPaths }}' | tr ',' '\n' | head -n 1)" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: "Copy files to Itch.io."
uses: act/common/itchio/butler-push@master
with:
file: ${{ steps.artifacts.outputs.file }}
account: ${{ inputs.account }}
project: ${{ inputs.project }}
channel: ${{ inputs.channel }}
apiKey: ${{ inputs.apiKey }}
version: ${{ inputs.version }}