bump-version workflow (WiseLibs/better-sqlite3)
The bump-version workflow from WiseLibs/better-sqlite3, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the bump-version workflow from the WiseLibs/better-sqlite3 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: bump-version
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Type of version bump
required: true
options:
- patch
- minor
- major
jobs:
bump:
name: Bump to a new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 20
- name: Configure user
run: |
git config --local user.name "${{ github.actor }}"
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
- name: Bump the version
run: npm version ${{ github.event.inputs.type }}
- name: Push commit
run: git push origin master:master
- name: Push tag
run: git push origin --tags
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: bump-version on: workflow_dispatch: inputs: type: type: choice description: Type of version bump required: true options: - patch - minor - major jobs: bump: timeout-minutes: 30 name: Bump to a new version runs-on: latchkey-small steps: - uses: actions/checkout@v6 with: token: ${{ secrets.PAT }} fetch-depth: 0 - uses: actions/setup-node@v6 with: cache: 'npm' node-version: 20 - name: Configure user run: | git config --local user.name "${{ github.actor }}" git config --local user.email "${{ github.actor }}@users.noreply.github.com" - name: Bump the version run: npm version ${{ github.event.inputs.type }} - name: Push commit run: git push origin master:master - name: Push tag run: git push origin --tags
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. - Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.