113 lines
3.3 KiB
YAML
113 lines
3.3 KiB
YAML
name: vociferate/run-vociferate
|
|
description: Resolve the preferred runtime for vociferate and execute it with a consistent output contract.
|
|
|
|
inputs:
|
|
root:
|
|
description: Repository root to pass to vociferate.
|
|
required: true
|
|
version-file:
|
|
description: Optional version file path.
|
|
required: false
|
|
default: ''
|
|
version-pattern:
|
|
description: Optional version pattern.
|
|
required: false
|
|
default: ''
|
|
changelog:
|
|
description: Optional changelog path.
|
|
required: false
|
|
default: ''
|
|
version:
|
|
description: Optional version argument.
|
|
required: false
|
|
default: ''
|
|
date:
|
|
description: Optional date argument.
|
|
required: false
|
|
default: ''
|
|
recommend:
|
|
description: Whether to run vociferate with --recommend.
|
|
required: false
|
|
default: 'false'
|
|
print-unreleased:
|
|
description: Whether to print the Unreleased body.
|
|
required: false
|
|
default: 'false'
|
|
print-release-notes:
|
|
description: Whether to print the release notes section for version.
|
|
required: false
|
|
default: 'false'
|
|
|
|
outputs:
|
|
stdout:
|
|
description: Captured stdout from the selected runtime.
|
|
value: ${{ steps.finalize.outputs.stdout }}
|
|
use_binary:
|
|
description: Whether the selected runtime was the released binary.
|
|
value: ${{ steps.resolve-runtime.outputs.use_binary }}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Resolve runtime
|
|
id: resolve-runtime
|
|
shell: bash
|
|
env:
|
|
ACTION_REF: ${{ github.action_ref }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if [[ "$ACTION_REF" == v* ]]; then
|
|
printf 'use_binary=true\n' >> "$GITHUB_OUTPUT"
|
|
else
|
|
printf 'use_binary=false\n' >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Run binary
|
|
id: run-binary
|
|
if: steps.resolve-runtime.outputs.use_binary == 'true'
|
|
uses: ./run-vociferate/binary
|
|
with:
|
|
root: ${{ inputs.root }}
|
|
version-file: ${{ inputs.version-file }}
|
|
version-pattern: ${{ inputs.version-pattern }}
|
|
changelog: ${{ inputs.changelog }}
|
|
version: ${{ inputs.version }}
|
|
date: ${{ inputs.date }}
|
|
recommend: ${{ inputs.recommend }}
|
|
print-unreleased: ${{ inputs.print-unreleased }}
|
|
print-release-notes: ${{ inputs.print-release-notes }}
|
|
|
|
- name: Run source
|
|
id: run-code
|
|
if: steps.resolve-runtime.outputs.use_binary != 'true'
|
|
uses: ./run-vociferate/code
|
|
with:
|
|
root: ${{ inputs.root }}
|
|
version-file: ${{ inputs.version-file }}
|
|
version-pattern: ${{ inputs.version-pattern }}
|
|
changelog: ${{ inputs.changelog }}
|
|
version: ${{ inputs.version }}
|
|
date: ${{ inputs.date }}
|
|
recommend: ${{ inputs.recommend }}
|
|
print-unreleased: ${{ inputs.print-unreleased }}
|
|
print-release-notes: ${{ inputs.print-release-notes }}
|
|
|
|
- name: Finalize stdout
|
|
id: finalize
|
|
shell: bash
|
|
env:
|
|
STDOUT_BINARY: ${{ steps.run-binary.outputs.stdout }}
|
|
STDOUT_CODE: ${{ steps.run-code.outputs.stdout }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
stdout="$STDOUT_BINARY"
|
|
if [[ -z "$stdout" ]]; then
|
|
stdout="$STDOUT_CODE"
|
|
fi
|
|
|
|
delimiter="EOF_STDOUT"
|
|
printf 'stdout<<%s\n' "$delimiter" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$stdout" >> "$GITHUB_OUTPUT"
|
|
printf '%s\n' "$delimiter" >> "$GITHUB_OUTPUT" |