Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ on:
required: true
type: string
dry-run:
description: Validate and print the release plan, but do not create a release or dispatch publishing.
description: Dry run
required: false
type: boolean
default: true
draft:
description: Create a draft GitHub Release for human review. Publish the draft manually to start publishing.
description: Draft release
required: false
type: boolean
default: true
Expand Down Expand Up @@ -81,14 +81,14 @@ jobs:

- name: Print release plan
env:
DRY_RUN: ${{ inputs.dry-run }}
DRY_RUN: ${{ inputs['dry-run'] && 'true' || 'false' }}
DISPLAY_PLATFORM: ${{ steps.release.outputs.display_platform }}
VERSION: ${{ steps.release.outputs.version }}
TAG: ${{ steps.release.outputs.tag }}
RELEASE_TITLE: ${{ steps.release.outputs.release_title }}
PRERELEASE: ${{ steps.release.outputs.prerelease }}
PUBLISH_WORKFLOW: ${{ steps.release.outputs.publish_workflow }}
DRAFT: ${{ inputs.draft }}
DRAFT: ${{ inputs.draft && 'true' || 'false' }}
run: |
set -euo pipefail
echo "Release plan:"
Expand All @@ -99,20 +99,20 @@ jobs:
echo " Prerelease: ${PRERELEASE}"
echo " Publish workflow: ${PUBLISH_WORKFLOW}"
echo " Dry run: ${DRY_RUN}"
echo " Draft: ${DRAFT}"
echo " Draft release: ${DRAFT}"
if [ "$DRY_RUN" = "false" ] && [ "$DRAFT" = "true" ]; then
echo " Publish dispatch: skipped until the draft release is manually published"
elif [ "$DRY_RUN" = "false" ]; then
echo " Publish dispatch: ${PUBLISH_WORKFLOW} will be dispatched after release creation"
fi

- name: Create GitHub Release
if: ${{ !inputs.dry-run }}
if: ${{ !inputs['dry-run'] }}
env:
TAG: ${{ steps.release.outputs.tag }}
RELEASE_TITLE: ${{ steps.release.outputs.release_title }}
PRERELEASE: ${{ steps.release.outputs.prerelease }}
DRAFT: ${{ inputs.draft }}
DRAFT: ${{ inputs.draft && 'true' || 'false' }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
Expand All @@ -131,7 +131,7 @@ jobs:
gh release create "${args[@]}"

- name: Dispatch publish workflow
if: ${{ !inputs.dry-run && !inputs.draft }}
if: ${{ !inputs['dry-run'] && !inputs.draft }}
env:
TAG: ${{ steps.release.outputs.tag }}
PUBLISH_WORKFLOW: ${{ steps.release.outputs.publish_workflow }}
Expand All @@ -143,6 +143,8 @@ jobs:

- name: Summary
env:
DRY_RUN: ${{ inputs['dry-run'] && 'true' || 'false' }}
DRAFT: ${{ inputs.draft && 'true' || 'false' }}
DISPLAY_PLATFORM: ${{ steps.release.outputs.display_platform }}
VERSION: ${{ steps.release.outputs.version }}
TAG: ${{ steps.release.outputs.tag }}
Expand All @@ -152,8 +154,8 @@ jobs:
cat >> "$GITHUB_STEP_SUMMARY" <<SUMMARY
## Release plan

- Dry run: `${{ inputs.dry-run }}`
- Draft: `${{ inputs.draft }}`
- Dry run: `${DRY_RUN}`
- Draft release: `${DRAFT}`
- Platform: ${DISPLAY_PLATFORM}
- Version: ${VERSION}
- Tag: \`${TAG}\`
Expand Down
Loading