zedbar 0.5.0

Pure Rust barcode and QR code scanning library supporting multiple formats
Documentation
name: Release Please

on:
  push:
    branches:
      - main

jobs:
  release-please:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    outputs:
      release_created: ${{ steps.release.outputs.release_created }}
      tag_name: ${{ steps.release.outputs.tag_name }}
    steps:
      - name: Generate GitHub App token
        id: app-token
        uses: actions/create-github-app-token@v3
        with:
          app-id: ${{ secrets.ZEDBAR_BOT_APP_ID }}
          private-key: ${{ secrets.ZEDBAR_BOT_PRIVATE_KEY }}

      - uses: googleapis/release-please-action@v5
        id: release
        with:
          # NB: no `release-type` here on purpose. Setting it puts the action
          # in its simple mode, where `release-please-config.json` is ignored
          # — and that config is the only place `bump-minor-pre-major` can be
          # set. The release type now lives in the config instead.
          #
          # The `release_created` and `tag_name` outputs below stay unprefixed
          # under this manifest config because the package path is ".";
          # any other path would emit them as `<path>--release_created`.
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
          # Use GitHub App token for authenticated, signed commits
          token: ${{ steps.app-token.outputs.token }}

  publish-crate:
    needs: release-please
    if: ${{ needs.release-please.outputs.release_created }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v6
      
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      
      - name: Publish to crates.io
        run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  publish-npm:
    needs: release-please
    if: ${{ needs.release-please.outputs.release_created }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
      
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      
      - name: Install wasm-pack
        run: cargo install wasm-pack
      
      - name: Setup Node.js
        uses: actions/setup-node@v6
        with:
          node-version: '24'
          registry-url: 'https://registry.npmjs.org'
      
      - name: Build npm package
        run: ./npm/build.sh
      
      - name: Publish to npm with provenance
        run: npm publish --provenance --access public
        working-directory: npm/pkg