Added new upload action.
This commit is contained in:
75
itchio/butler-push-previous-artifacts/action.yaml
Normal file
75
itchio/butler-push-previous-artifacts/action.yaml
Normal 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 }}
|
||||||
@@ -5,13 +5,13 @@ inputs:
|
|||||||
description: "Input file or folder to upload."
|
description: "Input file or folder to upload."
|
||||||
required: true
|
required: true
|
||||||
account:
|
account:
|
||||||
description: "ItchIo account name."
|
description: "Itch.io account name."
|
||||||
required: true
|
required: true
|
||||||
project:
|
project:
|
||||||
description: "ItchIo project name."
|
description: "Itch.io project name."
|
||||||
required: true
|
required: true
|
||||||
channel:
|
channel:
|
||||||
description: "ItchIo channel name."
|
description: "Itch.io channel name."
|
||||||
required: true
|
required: true
|
||||||
apiKey:
|
apiKey:
|
||||||
description: "Itch.io API key."
|
description: "Itch.io API key."
|
||||||
|
|||||||
Reference in New Issue
Block a user