data-modelling-sdk 2.4.0

Shared SDK for model operations across platforms (API, WASM, Native)
Documentation
name: Publish

on:
  workflow_dispatch: # Allow manual triggering
  push:
    branches: [main] # Trigger on merge to main

permissions:
  contents: write
  issues: write
  id-token: write # Required for npm provenance

jobs:
  # Step 1: Verify all versions are consistent
  version-check:
    name: Version Check
    uses: ./.github/workflows/version-check.yml

  # Step 2: Create GitHub Release (empty, to be populated by other jobs)
  create-release:
    name: Create GitHub Release
    needs: version-check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          tag_name: v${{ needs.version-check.outputs.version }}
          name: v${{ needs.version-check.outputs.version }}
          body: |
            ## Data Modelling SDK v${{ needs.version-check.outputs.version }}

            ### CLI Downloads

            The CLI includes embedded DuckDB database support for high-performance local queries.

            **Linux (x86_64)**
            - Binary: [odm-linux-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/v${{ needs.version-check.outputs.version }}/odm-linux-x86_64-v${{ needs.version-check.outputs.version }}.tar.gz)

            **macOS (Intel)**
            - Binary: [odm-macos-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/v${{ needs.version-check.outputs.version }}/odm-macos-x86_64-v${{ needs.version-check.outputs.version }}.tar.gz)

            **macOS (Apple Silicon)**
            - Binary: [odm-macos-arm64.tar.gz](https://github.com/${{ github.repository }}/releases/download/v${{ needs.version-check.outputs.version }}/odm-macos-arm64-v${{ needs.version-check.outputs.version }}.tar.gz)

            **Windows (x86_64)**
            - Binary: [odm-windows-x86_64.zip](https://github.com/${{ github.repository }}/releases/download/v${{ needs.version-check.outputs.version }}/odm-windows-x86_64-v${{ needs.version-check.outputs.version }}.zip)

            ### WASM Package

            **WebAssembly SDK** (for browser/web applications)
            - Archive: [data-modelling-sdk-wasm-v${{ needs.version-check.outputs.version }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/v${{ needs.version-check.outputs.version }}/data-modelling-sdk-wasm-v${{ needs.version-check.outputs.version }}.tar.gz)

            ### Rust Crate

            ```toml
            [dependencies]
            data-modelling-sdk = "${{ needs.version-check.outputs.version }}"
            ```

            ### npm Package

            ```bash
            npm install @offenedatenmodellierung/data-modelling-sdk@${{ needs.version-check.outputs.version }}
            ```

            ### CLI Installation

            **Linux/macOS:**
            ```bash
            tar -xzf odm-*-v${{ needs.version-check.outputs.version }}.tar.gz
            sudo mv odm /usr/local/bin/
            ```

            **Windows:**
            ```powershell
            Expand-Archive odm-windows-x86_64-v${{ needs.version-check.outputs.version }}.zip
            # Add to PATH or use full path
            ```

            See [CLI.md](https://github.com/${{ github.repository }}/blob/main/CLI.md) for CLI usage instructions.
          draft: false
          prerelease: false

  # Step 3: Publish to crates.io (core first, then SDK)
  release-sdk:
    name: Release SDK
    needs: [version-check, create-release]
    uses: ./.github/workflows/release-sdk.yml
    with:
      version: ${{ needs.version-check.outputs.version }}
    secrets: inherit

  # Step 4: Build and release CLI binaries (uploads to GitHub release)
  release-cli:
    name: Release CLI
    needs: [version-check, create-release]
    uses: ./.github/workflows/release-cli.yml
    with:
      version: ${{ needs.version-check.outputs.version }}
    secrets: inherit

  # Step 5: Build and release WASM + npm package (uploads to GitHub release)
  release-wasm:
    name: Release WASM
    needs: [version-check, create-release]
    uses: ./.github/workflows/release-wasm.yml
    with:
      version: ${{ needs.version-check.outputs.version }}
      publish_npm: true
    secrets: inherit