Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/notify-unitsdb-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Not auto-generated by Cimas — hand-maintained cross-repo trigger.
name: notify-unitsdb-js

# After every unitsdb release (which bumps lib/unitsdb/version.rb on
# main), dispatch to unitsml/unitsdb-js so it can compile the new
# version and publish to npm as @unitsml/unitsdb.
#
# unitsdb-js's release.yml is idempotent: if a version is already on
# npm it skips cleanly, so re-running after a transient failure (or
# re-dispatching) is safe.

on:
push:
branches: [main]
paths:
- "lib/unitsdb/version.rb"

permissions:
contents: read

jobs:
dispatch:
if: contains(github.event.head_commit.message, 'Bump unitsdb to')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2

- name: Extract released version
id: ver
run: |
set -eu
VERSION=$(grep -oE 'VERSION = "[^"]+"' lib/unitsdb/version.rb | head -1 | cut -d'"' -f2)
if [ -z "$VERSION" ]; then
echo "::error::could not read VERSION from lib/unitsdb/version.rb"
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Detected version $VERSION"

- name: Dispatch do-release to unitsml/unitsdb-js
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.UNITSML_CI_PAT_TOKEN }}
repository: unitsml/unitsdb-js
event-type: do-release
client-payload: |
{
"version": "${{ steps.ver.outputs.version }}",
"ruby_ref": "v${{ steps.ver.outputs.version }}"
}
Loading