oxios 1.10.0

Oxios Agent OS — Agent Operating System powered by oxi-sdk
name: Release (Web UI)

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: read
  # `actions: write` lets the `trigger-publish` job dispatch publish.yml
  # via `gh workflow run` (same-repo dispatch works with GITHUB_TOKEN).
  actions: write

jobs:
  release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v5

      - uses: oven-sh/setup-bun@v2

      # ─── Build web assets ──────────────────────────────────────────
      - name: Build web assets
        working-directory: web
        run: bun install && bun run build

      # ─── Package and create GitHub Release ───────────────────────
      - name: Package web assets
        run: |
          cd web/dist
          zip -r $GITHUB_WORKSPACE/web-dist.zip .

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          files: web-dist.zip
          generate_release_notes: true

  # ── Trigger crates.io publish ──────────────────────────────────
  # A Release created with GITHUB_TOKEN does NOT emit a `release: published`
  # event to other workflows (GitHub suppresses this to prevent loops), so
  # publish.yml's `on: release` trigger never fires. Dispatch it explicitly
  # here once the Release is live. publish.yml verifies the Release exists
  # before publishing.
  trigger-publish:
    name: Trigger crates.io publish
    needs: release
    runs-on: ubuntu-latest
    steps:
      # `gh workflow run` resolves the target workflow file from the *local*
      # git checkout, so it needs an actions/checkout step. Without it the
      # job fails with `fatal: not a git repository`.
      - uses: actions/checkout@v5
      - name: Dispatch publish workflow
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh workflow run publish.yml -f dry_run=false
          echo "publish.yml dispatched for $GITHUB_REF_NAME"