native_db 0.8.2

Drop-in embedded database
Documentation
name: Release

on:
  push:
    branches: [ main, 0.8.x ]       # automatic release after merge
  workflow_dispatch:         # manual release trigger

permissions:
  contents: write            # release step will need this
  checks: read
  actions: read

jobs:
  wait-for-workflows:
    runs-on: ubuntu-latest
    timeout-minutes: 45
    if: github.event_name == 'push'  # only wait for workflows on automatic triggers
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - uses: int128/wait-for-workflows-action@v1.43.0
        with:
          token: ${{ secrets.PAT_GLOBAL }}
          filter-workflow-events: push
          sha: ${{ github.sha }}

  release:
    name: Release
    runs-on: ubuntu-latest
    # needs: [wait-for-workflows]  # TEMPORARILY COMMENTED FOR TESTING
    if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/0.8.x')
    permissions:
      contents: write
      packages: write
    steps:
      - name: Checkout code
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
        with:
          ref: ${{ github.ref_name }}
          fetch-depth: 0

      - name: install npm
        uses: actions/setup-node@v4
        with:
          node-version: '20.19.2'

      - name: Semantic Release
        uses: cycjimmy/semantic-release-action@v4
        with:
          dry_run: ${{ github.event_name != 'workflow_dispatch' }}
          extra_plugins: |
            @semantic-release/commit-analyzer
            @semantic-release/release-notes-generator
            @semantic-release/exec
            @semantic-release/github
        env:
          GITHUB_TOKEN: ${{ secrets.PAT_GLOBAL }}
          CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}