From 9cd0db9272fc594899b14a16f8dcdda6eabf8623 Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Fri, 9 Oct 2026 17:14:57 +0000 Subject: [PATCH] ci(wasm): publish the wasm bundles on v* tags, like publish-cvcpkg publish-cvcgl-wasm (libcvc + cvcgl + the cvcgl-examples gallery for wasm-mt) and publish-pycvc-gl-wasm (pycvc-gl-cp312 for wasm) were dispatch-only, so a release tag published the native family but left wasm behind until someone dispatched them by hand (3.5.0's wasm went out a day after the tag). - Both now also run on `push: tags: ['v*']`, the trigger publish-cvcpkg.yml uses, and publish on a tag push. - Manual dispatch is unchanged: still a dry run by default, dry_run=false publishes. publish-cvcgl-wasm reads an explicit job-level DRY_RUN (true only for a dispatch with dry_run checked) instead of an inputs.dry_run that is empty on a push; publish-pycvc-gl-wasm's publish step gates on `github.event_name == 'push' || inputs.dry_run == false` instead of relying on null == false coercion. - pycvc-gl-wasm compiles cvc + cvcGL from source, so running both on the same tag does not race on publish-cvcgl-wasm's bundles. --- .github/workflows/publish-cvcgl-wasm.yml | 14 ++++++++++---- .github/workflows/publish-pycvc-gl-wasm.yml | 9 +++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-cvcgl-wasm.yml b/.github/workflows/publish-cvcgl-wasm.yml index ac15b5d16..25710df12 100644 --- a/.github/workflows/publish-cvcgl-wasm.yml +++ b/.github/workflows/publish-cvcgl-wasm.yml @@ -16,10 +16,14 @@ name: publish-cvcgl-wasm # # Runner-agnostic: runs on GitHub-hosted ubuntu-latest and provisions the emsdk # toolchain + cmake/ninja from the cvcpkg catalog, so it is not tied to any one -# box (it used to require catx-03's pre-installed /opt/cvc-wasm/emsdk). Dry-run by -# default (builds + packs, no publish); set dry_run=false to publish. +# box (it used to require catx-03's pre-installed /opt/cvc-wasm/emsdk). A v* tag +# push builds AND publishes, like publish-cvcpkg.yml; a manual dispatch is a dry run +# by default (builds + packs, no publish) -- set dry_run=false to publish. on: + push: + tags: + - 'v*' workflow_dispatch: inputs: dry_run: @@ -42,6 +46,8 @@ jobs: EMSDK_DIR: ${{ github.workspace }}/emsdk WASM_DEPS: ${{ github.workspace }}/wasm-deps INST: ${{ github.workspace }}/wasm-inst + # Only a manual dispatch can dry-run; a tag push always publishes. + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} steps: - uses: actions/checkout@v4 @@ -147,7 +153,7 @@ jobs: --local --output-dir dist done ls -la dist/ - if [ "${{ inputs.dry_run }}" = "true" ]; then + if [ "$DRY_RUN" = "true" ]; then echo "dry-run: built + packed, not publishing"; exit 0 fi [ -n "${CVCPKG_TOKEN:-}" ] || { echo "::error::CVCPKG_TOKEN required to publish"; exit 1; } @@ -212,7 +218,7 @@ jobs: --platform wasm-mt --config release --link static \ --local --output-dir dist ls -la dist/cvcgl-examples-*wasm-mt* || true - if [ "${{ inputs.dry_run }}" = "true" ]; then + if [ "$DRY_RUN" = "true" ]; then echo "dry-run: built + packed cvcgl-examples gallery, not publishing"; exit 0 fi [ -n "${CVCPKG_TOKEN:-}" ] || { echo "::error::CVCPKG_TOKEN required to publish"; exit 1; } diff --git a/.github/workflows/publish-pycvc-gl-wasm.yml b/.github/workflows/publish-pycvc-gl-wasm.yml index 76391ce32..efe31f477 100644 --- a/.github/workflows/publish-pycvc-gl-wasm.yml +++ b/.github/workflows/publish-pycvc-gl-wasm.yml @@ -6,8 +6,13 @@ name: publish-pycvc-gl-wasm # browser. Runner-agnostic (ubuntu-latest), self-provisioning emsdk + cmake/ninja # from the cvcpkg catalog, mirroring publish-cvcgl-wasm.yml. The wasm deps are # INSTALLED into the build prefix first (cvcpkg build reads them as CVC_DEPS_PREFIX; -# without them configure fails at find_package(Boost)). dry_run=false to publish. +# without them configure fails at find_package(Boost)). A v* tag push publishes, like +# publish-cvcpkg.yml; a manual dispatch publishes only with dry_run=false. It compiles +# cvc + cvcGL from source, so it does not wait on publish-cvcgl-wasm's bundles. on: + push: + tags: + - 'v*' workflow_dispatch: inputs: dry_run: @@ -92,7 +97,7 @@ jobs: if-no-files-found: warn - name: Publish pycvc-gl-cp312 wasm - if: ${{ inputs.dry_run == false }} + if: ${{ github.event_name == 'push' || inputs.dry_run == false }} run: | cvcpkg pack cvcpkg/recipes/pycvc-gl-cp312 --from-prefix "$WASM_DEPS" \ --platform wasm --config release --link static --output-dir dist