Files
common/itchio/butler-push-previous-artifacts/action.yaml
2025-07-10 22:45:01 -07:00

76 lines
2.5 KiB
YAML

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. Default: the repository name."
required: true
default: ""
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-artifact@master
id: download
with:
workflowPattern: ${{ inputs.workflowPattern }}
artifactPattern: ${{ inputs.artifactPattern }}
password: ${{ inputs.password }}
nugetPasswords: ${{ inputs.nugetPasswords || inputs.password }}
unzipDir: ${{ inputs.unzipDir }}
- name: "Get Project name."
id: project
run: |
if [[ -n "${{ inputs.project }}" ]]; then
echo "destProject=${{ inputs.project }}" >> "$GITHUB_OUTPUT"
else
REPO="${{ github.repository }}"
REPO="${REPO##*/}"
echo "destProject=$REPO" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: "Copy files to Itch.io."
uses: act/common/itchio/butler-push@master
with:
file: ${{ steps.download.outputs.downloadedArtifactPath }}
account: ${{ inputs.account }}
project: ${{ steps.project.outputs.destProject }}
channel: ${{ inputs.channel }}
apiKey: ${{ inputs.apiKey }}
version: ${{ inputs.version }}