drizzle 0.1.6

A type-safe SQL query builder for Rust
Documentation
name: Update

on:
  # Auto-create / update the release PR on every push to main. release-plz
  # internally checks whether there's anything releasable since the last tag —
  # if not (e.g. the push was a pure chore: / style: commit that our parser
  # skips, and no other unreleased work exists), no PR is created or updated.
  # Manual trigger is kept so you can force a refresh if needed.
  workflow_dispatch:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

concurrency:
  # Single in-flight release-PR update per branch — rapid pushes coalesce so
  # we only do the work once, against the latest commit.
  group: update-${{ github.ref }}
  cancel-in-progress: true

jobs:
  update:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    # Skip when the push is the release-PR merge commit itself (release-plz
    # would just no-op anyway, but the CI run still takes ~2 minutes).
    # workflow_dispatch always runs so you can force a refresh if needed.
    if: >-
      github.event_name == 'workflow_dispatch' ||
      !startsWith(github.event.head_commit.message, 'chore: release')
    steps:
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Get Rust version
        id: rust-version
        run: |
          RUST_VERSION=$(grep '^rust-version = ' Cargo.toml | sed 's/rust-version = "\(.*\)"/\1/')
          echo "version=$RUST_VERSION" >> $GITHUB_OUTPUT

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ steps.rust-version.outputs.version }}

      - name: Install nightly Rust for formatting
        uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt

      - name: Cache Rust dependencies
        uses: Swatinem/rust-cache@v2
        with:
          shared-key: msrv

      # Format before release-plz so any formatting changes are included in the release PR
      - name: Format code with nightly
        run: cargo +nightly fmt

      - name: Install release-plz
        uses: taiki-e/install-action@v2
        with:
          tool: release-plz

      - name: Create release PR
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          release-plz release-pr --git-token "$GITHUB_TOKEN" || {
            echo "::error::release-plz release-pr failed"
            exit 1
          }