Skip to content
Latchkey

bump-version workflow (WiseLibs/better-sqlite3)

The bump-version workflow from WiseLibs/better-sqlite3, explained and optimized by Latchkey.

C

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.

Grade your own workflow free or run it on Latchkey →
Source: WiseLibs/better-sqlite3.github/workflows/bump-version.ymlLicense MITView source

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

workflow (.yml)
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

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow