Release (release type: patch, dry-run: false, verbose: true) #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
description: 'Release type.' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
verbose: | ||
description: "If to output a summary." | ||
required: false | ||
type: boolean | ||
default: true | ||
dryRun: | ||
description: "If to perform a dryRun without push at the end." | ||
required: false | ||
type: boolean | ||
default: true | ||
workflow_call: | ||
inputs: | ||
release_type: | ||
description: 'Release type.' | ||
required: true | ||
default: 'patch' | ||
type: string | ||
verbose: | ||
description: "If to output a summary." | ||
required: false | ||
type: boolean | ||
default: false | ||
dryRun: | ||
description: "If to perform a dryRun without push at the end." | ||
required: false | ||
type: boolean | ||
default: false | ||
outputs: | ||
version: | ||
description: "Released version" | ||
value: ${{ jobs.version.outputs.version }} | ||
nextVersion: | ||
description: "Snapshot version" | ||
value: ${{ jobs.version.outputs.nextVersion }} | ||
run-name: | | ||
${{ github.workflow }} (release type: ${{ github.event.inputs.release_type }}, dry-run: ${{ github.event.inputs.dryRun }}, verbose: ${{ github.event.inputs.verbose }}) | ||
env: | ||
# https://github.com/actions/runner-images/issues/70 | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
permissions: | ||
contents: write | ||
jobs: | ||
version: | ||
name: "Release Version" | ||
uses: "./.github/workflows/release-version.yml" | ||
secrets: inherit | ||
with: | ||
release_type: ${{ github.event.inputs.release_type }} | ||
verbose: ${{ github.event.inputs.verbose == 'true'}} | ||
build: | ||
name: "Build" | ||
uses: "./.github/workflows/build.yml" | ||
needs: | ||
- version | ||
main: | ||
name: "Main" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: | ||
- build | ||
- version | ||
env: | ||
dryRun: ${{ github.event.inputs.dryRun == 'true' }} | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ needs.build.outputs.artifact-name }} | ||
- id: gh-release | ||
if: ${{ !env.dryRun }} | ||
name: "Create Release" | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: ${{ needs.build.outputs.artifact-name }}.zip | ||
- id: gh-release-dry-run | ||
if: ${{ env.dryRun }} | ||
name: "Create Release (Dry Run)" | ||
run: | | ||
echo "Would create a release with ${{ needs.build.outputs.artifact-name }}.zip" | ||
verbose: | ||
name: "Verbose" | ||
runs-on: ubuntu-latest | ||
needs: main | ||
env: | ||
verbose: ${{ github.event.inputs.verbose == 'true'}} | ||
if: ${{ env.verbose }} | ||
Check failure on line 106 in .github/workflows/release.yml GitHub Actions / ReleaseInvalid workflow file
|
||
steps: | ||
- id: output | ||
name: "Output" | ||
run: | | ||
echo "# Release Version" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "## Parameters" >> $GITHUB_STEP_SUMMARY | ||
echo "* Released Type: ${{ inputs.release_type }}" >> $GITHUB_STEP_SUMMARY | ||
echo "* Verbose: ${{ inputs.verbose }}" >> $GITHUB_STEP_SUMMARY | ||
echo "* Dry-Run: ${{ inputs.dryRun }}" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "## Result" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "* Released Version: _TODO_" >> $GITHUB_STEP_SUMMARY | ||
echo "* Snapshot Version: _TODO_" >> $GITHUB_STEP_SUMMARY |