Create Release workflow (wizarrrr/wizarr)
The Create Release workflow from wizarrrr/wizarr, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Create Release workflow from the wizarrrr/wizarr repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Create Release
on:
pull_request:
branches: [main]
types: [closed]
jobs:
create-release:
runs-on: ubuntu-24.04
if: |
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.title, 'Release v') &&
github.repository_owner == 'wizarrrr'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Extract version from PR title
id: version
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
VERSION=$(echo "$PR_TITLE" | sed 's/Release v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
run: |
# Save PR body to file to avoid shell injection
cat > pr_body.md << 'EOF'
${{ github.event.pull_request.body }}
EOF
# Extract changelog from PR body (remove the footer)
sed '/^---$/,$d' pr_body.md > changelog.md
# Create the release (explicitly published, not draft)
echo "Creating published release ${{ steps.version.outputs.tag }}..."
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.tag }}" \
--notes-file changelog.md \
--latest
# Verify the release was published (not draft)
RELEASE_INFO=$(gh release view "${{ steps.version.outputs.tag }}" --json isDraft,url)
IS_DRAFT=$(echo "$RELEASE_INFO" | jq -r '.isDraft')
RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r '.url')
if [[ "$IS_DRAFT" == "true" ]]; then
echo "β ERROR: Release was created as draft! This will not trigger wizarr-release workflow."
exit 1
else
echo "β
Release successfully published and will trigger wizarr-release workflow"
fi
echo "html_url=$RELEASE_URL" >> $GITHUB_OUTPUT
- name: Summary
run: |
echo "π **Release Created & Published!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ steps.version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release URL**: ${{ steps.create_release.outputs.html_url }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## What happens next:" >> $GITHUB_STEP_SUMMARY
echo "1. βοΈ **wizarr-release** workflow is now triggered (Docker build)" >> $GITHUB_STEP_SUMMARY
echo "2. π¦ Docker images built for linux/amd64 and linux/arm64" >> $GITHUB_STEP_SUMMARY
echo "3. π·οΈ Images tagged as \`:latest\` and \`:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "4. π Images pushed to ghcr.io/${{ github.repository_owner }}/wizarr" >> $GITHUB_STEP_SUMMARY
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Create Release on: pull_request: branches: [main] types: [closed] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: create-release: timeout-minutes: 30 runs-on: latchkey-small if: | github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release v') && github.repository_owner == 'wizarrrr' permissions: contents: write steps: - name: Checkout uses: actions/checkout@v7 with: token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} fetch-depth: 0 - name: Extract version from PR title id: version run: | PR_TITLE="${{ github.event.pull_request.title }}" VERSION=$(echo "$PR_TITLE" | sed 's/Release v//') echo "version=$VERSION" >> $GITHUB_OUTPUT echo "tag=v$VERSION" >> $GITHUB_OUTPUT - name: Create GitHub Release id: create_release env: GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} run: | # Save PR body to file to avoid shell injection cat > pr_body.md << 'EOF' ${{ github.event.pull_request.body }} EOF # Extract changelog from PR body (remove the footer) sed '/^---$/,$d' pr_body.md > changelog.md # Create the release (explicitly published, not draft) echo "Creating published release ${{ steps.version.outputs.tag }}..." gh release create "${{ steps.version.outputs.tag }}" \ --title "${{ steps.version.outputs.tag }}" \ --notes-file changelog.md \ --latest # Verify the release was published (not draft) RELEASE_INFO=$(gh release view "${{ steps.version.outputs.tag }}" --json isDraft,url) IS_DRAFT=$(echo "$RELEASE_INFO" | jq -r '.isDraft') RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r '.url') if [[ "$IS_DRAFT" == "true" ]]; then echo "β ERROR: Release was created as draft! This will not trigger wizarr-release workflow." exit 1 else echo "β Release successfully published and will trigger wizarr-release workflow" fi echo "html_url=$RELEASE_URL" >> $GITHUB_OUTPUT - name: Summary run: | echo "π **Release Created & Published!**" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "- **Version**: ${{ steps.version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY echo "- **Release URL**: ${{ steps.create_release.outputs.html_url }}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "## What happens next:" >> $GITHUB_STEP_SUMMARY echo "1. βοΈ **wizarr-release** workflow is now triggered (Docker build)" >> $GITHUB_STEP_SUMMARY echo "2. π¦ Docker images built for linux/amd64 and linux/arm64" >> $GITHUB_STEP_SUMMARY echo "3. π·οΈ Images tagged as \`:latest\` and \`:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY echo "4. π Images pushed to ghcr.io/${{ github.repository_owner }}/wizarr" >> $GITHUB_STEP_SUMMARY
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Container pulls and builds
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.