diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ec58866 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +name: Publish SDKs + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + publish-rust: + name: Publish Rust Crate + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Map Kellnr Host + run: | + if sudo -n true 2>/dev/null; then + echo "192.168.1.2 kellnr.cntm.labs" | sudo tee -a /etc/hosts + fi + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + - name: Setup Protoc + uses: arduino/setup-protoc@v3 + - name: Publish to Kellnr + env: + SHARED_TOKEN: ${{ secrets.KELLNR_TOKEN }} + run: | + cargo login --registry vtuber-registry "$SHARED_TOKEN" + cargo publish --registry vtuber-registry --allow-dirty + + generate-interop-files: + name: Generate Interop Files (Non-Publish) + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Setup buf + uses: bufbuild/buf-setup-action@v1 + with: + version: "1.68.4" + - name: Generate Python and TS + run: | + buf generate --template buf.gen.yaml + echo "✅ Interop files generated in 'generated/' folder." + echo "ℹ️ Per architectural decision: Only Rust is published to Kellnr." + echo "ℹ️ Python/TS are used via cross-repo interop/submodules if needed." diff --git a/docs/superpowers/plans/2026-05-10-serde-registry-integration.md b/docs/superpowers/plans/2026-05-10-serde-registry-integration.md index c6f1dec..bfbda47 100644 --- a/docs/superpowers/plans/2026-05-10-serde-registry-integration.md +++ b/docs/superpowers/plans/2026-05-10-serde-registry-integration.md @@ -49,3 +49,66 @@ - [ ] **Step 1: Run full test suite (cargo test, pixi run test, buf lint)** - [ ] **Step 2: Update STRUCTURE.tree and push changes** + +--- + +### Task 6: Implement Publishing Workflow + +**Files:** +- Create: `.github/workflows/publish.yml` + +- [ ] **Step 1: Create publish.yml with Multi-Registry support** + +```yaml +name: Publish SDKs + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + publish-rust: + name: Publish Rust Crate + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Map Kellnr Host + run: | + if sudo -n true 2>/dev/null; then + echo "192.168.1.2 kellnr.cntm.labs" | sudo tee -a /etc/hosts + fi + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + - name: Setup Protoc + uses: arduino/setup-protoc@v3 + - name: Publish to Kellnr + env: + SHARED_TOKEN: ${{ secrets.KELLNR_TOKEN }} + run: | + cargo login --registry vtuber-registry "$SHARED_TOKEN" + cargo publish --registry vtuber-registry --allow-dirty + + publish-python: + name: Publish Python Stubs + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Map Kellnr Host + run: | + if sudo -n true 2>/dev/null; then + echo "192.168.1.2 kellnr.cntm.labs" | sudo tee -a /etc/hosts + fi + - name: Setup buf + uses: bufbuild/buf-setup-action@v1 + with: + version: "1.68.4" + - name: Generate and Publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.KELLNR_TOKEN }} + TWINE_REPOSITORY_URL: http://kellnr.cntm.labs:31500/api/v1/pypi + run: | + buf generate + # TODO: Add python packaging logic here if needed diff --git a/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md b/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md index f7e4c09..a68d895 100644 --- a/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md +++ b/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md @@ -29,3 +29,25 @@ This specification details the implementation of Serde support for all generated ## ⚖️ Future Considerations - Transitioning from manual file copying to BSR (Buf Schema Registry) once the initial local registry flow is stabilized. + +## 🚀 Phase 2: Automated SDK Publishing (Issue #4) + +### 1. Workflow Architecture +- **Trigger:** Git tags matching `v*`. +- **Runner:** `self-hosted` (local lab network). +- **Environment:** Manual mapping of `192.168.1.2` to `kellnr.cntm.labs` within the workflow. + +### 2. Multi-Language Publishing Logic +- **Rust:** Uses native `cargo publish` with the pre-configured `vtuber-registry`. +- **Python:** + - Generates code via `buf`. + - Packages as a wheel. + - Publishes to Kellnr PyPI via `twine`. +- **TypeScript:** + - Generates code via `buf`. + - Publishes to Kellnr NPM via `npm publish`. +- **GitHub Packages:** Parallel steps to publish to `ghcr.io` or GitHub's language-specific registries as a fallback. + +### 3. Secrets Required +- `KELLNR_TOKEN`: For private registry authentication. +- `GITHUB_TOKEN`: Provided automatically by GitHub Actions.