From 698168c395e13ef5915f87e99e668e8498edc779 Mon Sep 17 00:00:00 2001 From: Dan Ditomaso Date: Tue, 14 Oct 2025 10:42:17 -0400 Subject: [PATCH] fixes --- .github/workflows/release-protobufs.yml | 44 ++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-protobufs.yml b/.github/workflows/release-protobufs.yml index 1858d859..b1ee9224 100644 --- a/.github/workflows/release-protobufs.yml +++ b/.github/workflows/release-protobufs.yml @@ -1,4 +1,4 @@ -name: Release Protobuf to JSR +name: Create Protobuf Release for JSR on: workflow_dispatch: @@ -51,6 +51,7 @@ jobs: run: | set -euxo pipefail for f in deno.json; do + test -f "$f" jq --arg version "${VERSION//\//-}" ' walk( if type == "string" and test("__PACKAGE_VERSION__") @@ -88,6 +89,7 @@ jobs: exit 1 fi + # Remove nanopb_pb.ts if present if [ -f "$DEST_DIR/nanopb_pb.ts" ]; then rm "$DEST_DIR/nanopb_pb.ts" fi @@ -96,3 +98,43 @@ jobs: run: | cp LICENSE $PROTOBUF_DIR/packages/ts cp README.md $PROTOBUF_DIR/packages/ts + + - name: Upload TypeScript code + uses: actions/upload-artifact@v4 + with: + name: ts_code + path: ${{ env.PROTOBUF_DIR }}/packages/ts + + - name: Push to schema registry + env: + BUF_TOKEN: ${{ secrets.BUF_TOKEN }} + run: buf push --tag ${{ github.ref_name }} + + publish-jsr: + runs-on: ubuntu-24.04 + needs: codegen + permissions: + contents: read + id-token: write + env: + DRY_RUN: ${{ inputs.dry_run }} + steps: + - name: Download TypeScript code + uses: actions/download-artifact@v4 + with: + name: ts_code + + - name: Set up Deno + uses: denoland/setup-deno@main + with: + deno-version: rc + + - name: Publish to JSR + run: | + set -euxo pipefail + FLAGS="--unstable-sloppy-imports" + if [ "${DRY_RUN}" = "true" ]; then + FLAGS="$FLAGS --dry-run" + echo "Running publish in dry-run mode..." + fi + deno publish $FLAGS