Prepare release workflow (mirumee/ariadne)
The Prepare release workflow from mirumee/ariadne, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Prepare release workflow from the mirumee/ariadne repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Prepare release
on:
push:
tags:
- '*'
workflow_call:
workflow_dispatch:
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
build:
uses: ./.github/workflows/build.yml
permissions:
contents: read
id-token: write # IMPORTANT: mandatory for sigstore in build.yml
create-release:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release notes
id: release-notes
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip all
env:
OUTPUT: RELEASE_NOTES.md
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Release
id: create-draft-release
uses: softprops/action-gh-release@v2
with:
files: |
./dist/*
draft: true
body_path: RELEASE_NOTES.md
- name: Summary
run: |
echo "# Release summary" >> $GITHUB_STEP_SUMMARY
echo "Url: ${{ steps.create-draft-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY
echo "You can now publish the release on GitHub" >> $GITHUB_STEP_SUMMARY
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Prepare release on: push: tags: - '*' workflow_call: workflow_dispatch: env: PYTHONUNBUFFERED: "1" FORCE_COLOR: "1" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 uses: ./.github/workflows/build.yml permissions: contents: read id-token: write # IMPORTANT: mandatory for sigstore in build.yml create-release: timeout-minutes: 30 needs: - build runs-on: latchkey-small permissions: contents: write pull-requests: read steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Generate release notes id: release-notes uses: orhun/git-cliff-action@v4 with: config: cliff.toml args: --latest --strip all env: OUTPUT: RELEASE_NOTES.md GITHUB_REPO: ${{ github.repository }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Download all the dists uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ - name: Release id: create-draft-release uses: softprops/action-gh-release@v2 with: files: | ./dist/* draft: true body_path: RELEASE_NOTES.md - name: Summary run: | echo "# Release summary" >> $GITHUB_STEP_SUMMARY echo "Url: ${{ steps.create-draft-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY echo "You can now publish the release on GitHub" >> $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.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.