Skip to content
Merged
Show file tree
Hide file tree
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
72 changes: 27 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@
# stdlib bundle + sealed-snapshot generation, and a node smoke test that
# loads the built module and asserts snapshot replay is engaged. On tags
# it uploads the npm package tarball (built wasm module + stdlib
# artifacts inside) so every release carries the package, and it
# publishes the tarball to the org's GitHub Packages npm registry
# (@sysml/wasm — consumed by downstream deploy
# pipelines). A workflow_dispatch run publishes too, so a package
# version can ship without cutting a full release. The publish is
# idempotent — an already-published version is skipped, since GitHub
# Packages versions are immutable. Nothing is ever published to the
# public npm registry.
# artifacts inside) so every release carries the package. When an
# NPM_TOKEN secret is configured it also publishes the tarball to the
# npm registry as @sysml/wasm (tags and manual runs); without the secret
# the publish is skipped and the release still ships the tarball as an
# asset. The publish is idempotent — an already-published version is
# skipped.
#
# Notes for this repository:
# - The full corpus gates run in the test job: the SysML-v2-Release
Expand All @@ -56,9 +54,8 @@ on:
# (synchronize) re-runs the full test gates.
types: [opened, synchronize, reopened]
branches: [main, develop]
# Manual runs publish the wasm npm package from the chosen ref (wasm
# job) without cutting a release — e.g. the first 0.1.0 publish, or a
# develop-side kernel a consumer needs before the next release tag.
# Manual runs build (and, with NPM_TOKEN, publish) the wasm npm
# package from the chosen ref without cutting a release.
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -115,11 +112,8 @@ jobs:
wasm:
name: wasm (wasm32 gate + npm package + node smoke)
runs-on: ubuntu-latest
# Job-scoped: publishing to GitHub Packages needs packages: write,
# which no other job should hold.
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
- name: Fetch the standard library (sparse, blob-filtered)
Expand Down Expand Up @@ -164,50 +158,38 @@ jobs:
name: sysmlv2-wasm-npm
path: crates/sysmlv2-wasm/npm/dist/*.tgz
if-no-files-found: error
- name: Publish to GitHub Packages (tags + manual runs)
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
env:
NPM_TOKEN: ${{ github.token }}
# Fine-grained PAT, Contents: read+write on the consumer repo
# named by the KERNEL_CONSUMER_REPO variable — lets a fresh
# publish nudge that repo to bump its kernel pin
# (repository_dispatch). Optional: either unset skips the nudge.
DISPATCH_TOKEN: ${{ secrets.KERNEL_CONSUMER_DISPATCH_TOKEN }}
DISPATCH_REPO: ${{ vars.KERNEL_CONSUMER_REPO }}
- name: Check the tag against the package version
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" > "$HOME/.npmrc"
version=$(node -p "require('./crates/sysmlv2-wasm/npm/pkg/package.json').version")
# The package version comes from Cargo.toml ([workspace.package]),
# not from the tag — refuse to publish a release whose tag and
# source version disagree. Failing here also blocks the release
# job (needs: wasm), so mismatched binaries never ship either.
if [[ "$GITHUB_REF" == refs/tags/v* && "${GITHUB_REF_NAME#v}" != "$version" ]]; then
# not from the tag — refuse a release whose tag and source
# version disagree. Failing here also blocks the release job
# (needs: wasm), so mismatched binaries never ship either.
if [[ "${GITHUB_REF_NAME#v}" != "$version" ]]; then
echo "::error::tag ${GITHUB_REF_NAME} but package version ${version} — bump [workspace.package] version (and sibling dep pins) before tagging"
exit 1
fi
- name: Publish to npm (tags + manual runs, when NPM_TOKEN is configured)
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [[ -z "$NPM_TOKEN" ]]; then
echo "NPM_TOKEN not configured — skipping the npm publish (the tarball ships as a release asset)"
exit 0
fi
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "$HOME/.npmrc"
version=$(node -p "require('./crates/sysmlv2-wasm/npm/pkg/package.json').version")
# A prerelease (a `-` in the version) publishes under the `next`
# dist-tag so `latest` keeps naming the newest stable version.
dist_tag=latest
case "$version" in *-*) dist_tag=next ;; esac
if npm view "@sysml/wasm@${version}" version \
--registry=https://npm.pkg.github.com >/dev/null 2>&1; then
if npm view "@sysml/wasm@${version}" version >/dev/null 2>&1; then
echo "@sysml/wasm@${version} already published — skipping"
else
npm publish "crates/sysmlv2-wasm/npm/dist/sysml-wasm-${version}.tgz" \
--registry=https://npm.pkg.github.com --tag "$dist_tag"
# Tell the consumer repo a new kernel exists: its
# bump-kernel workflow rewrites the pin, commits, redeploys.
if [[ -n "$DISPATCH_TOKEN" && -n "$DISPATCH_REPO" ]]; then
curl -sSf -X POST \
-H "Authorization: Bearer ${DISPATCH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${DISPATCH_REPO}/dispatches" \
-d "{\"event_type\":\"kernel-published\",\"client_payload\":{\"version\":\"${version}\"}}" \
&& echo "dispatched kernel-published ${version} to ${DISPATCH_REPO}" \
|| echo "::warning::kernel-published dispatch to ${DISPATCH_REPO} failed"
else
echo "dispatch token or repo not configured — skipping the bump nudge"
fi
--access public --tag "$dist_tag"
fi

build:
Expand Down
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ default-members = [
]

[workspace.package]
version = "0.5.5-rc.1"
version = "0.6.0"
edition = "2021"
rust-version = "1.86"
license = "Apache-2.0"
repository = "https://github.com/Open-MBEE/sysml-toolkit"

[workspace.dependencies]
sysmlv2-parser = { path = "crates/sysmlv2-parser", version = "0.5.5-rc.1" }
sysmlv2-cbor = { path = "crates/sysmlv2-cbor", version = "0.5.5-rc.1" }
sysmlv2-solve = { path = "crates/sysmlv2-solve", version = "0.5.5-rc.1" }
sysmlv2-lint = { path = "crates/sysmlv2-lint", version = "0.5.5-rc.1" }
sysmlv2-parser = { path = "crates/sysmlv2-parser", version = "0.6.0" }
sysmlv2-cbor = { path = "crates/sysmlv2-cbor", version = "0.6.0" }
sysmlv2-solve = { path = "crates/sysmlv2-solve", version = "0.6.0" }
sysmlv2-lint = { path = "crates/sysmlv2-lint", version = "0.6.0" }
sysmlv2-testkit = { path = "crates/sysmlv2-testkit" }
sysmlv2-transform = { path = "crates/sysmlv2-transform", version = "0.5.5-rc.1" }
sysmlv2-viz = { path = "crates/sysmlv2-viz", version = "0.5.5-rc.1" }
sysmlv2-lsp = { path = "crates/sysmlv2-lsp", version = "0.5.5-rc.1" }
sysmlv2-transform = { path = "crates/sysmlv2-transform", version = "0.6.0" }
sysmlv2-viz = { path = "crates/sysmlv2-viz", version = "0.6.0" }
sysmlv2-lsp = { path = "crates/sysmlv2-lsp", version = "0.6.0" }
lsp-server = "0.7"
lsp-types = "0.97"
crossbeam-channel = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/sysmlv2-cbor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
include = ["src/**", "Cargo.toml", "README.md"]

[dependencies]
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
serde_json.workspace = true
uuid.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion crates/sysmlv2-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ xattr = "1"

[dev-dependencies]
sysmlv2-testkit.workspace = true
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
4 changes: 2 additions & 2 deletions crates/sysmlv2-lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repository.workspace = true
include = ["src/**", "Cargo.toml"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
serde_json.workspace = true
regex-lite.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion crates/sysmlv2-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
include = ["src/**", "build.rs", "Cargo.toml"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
serde.workspace = true
serde_json.workspace = true
uuid.workspace = true
4 changes: 2 additions & 2 deletions crates/sysmlv2-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ default = ["json"]
json = ["dep:sysmlv2-model", "dep:serde_json"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1", optional = true }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0", optional = true }
# for tests/examples that build serde_json values directly
serde_json = { workspace = true, optional = true }

Expand Down
10 changes: 5 additions & 5 deletions crates/sysmlv2-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ name = "sysmlv2"
crate-type = ["cdylib", "rlib"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-transform = { path = "../sysmlv2-transform", version = "0.5.5-rc.1" }
sysmlv2-viz = { path = "../sysmlv2-viz", version = "0.5.5-rc.1" }
sysmlv2-lsp = { path = "../sysmlv2-lsp", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
sysmlv2-transform = { path = "../sysmlv2-transform", version = "0.6.0" }
sysmlv2-viz = { path = "../sysmlv2-viz", version = "0.6.0" }
sysmlv2-lsp = { path = "../sysmlv2-lsp", version = "0.6.0" }
serde_json.workspace = true
pyo3 = { version = "0.23", features = ["abi3-py39"] }
4 changes: 2 additions & 2 deletions crates/sysmlv2-solve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repository.workspace = true
include = ["src/**", "Cargo.toml"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }

[dev-dependencies]
sysmlv2-testkit.workspace = true
6 changes: 3 additions & 3 deletions crates/sysmlv2-transform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ repository.workspace = true
include = ["src/**", "Cargo.toml"]

[dependencies]
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-cbor = { path = "../sysmlv2-cbor", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
sysmlv2-cbor = { path = "../sysmlv2-cbor", version = "0.6.0" }
uuid.workspace = true
serde_json.workspace = true

Expand Down
4 changes: 2 additions & 2 deletions crates/sysmlv2-viz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ license.workspace = true
repository.workspace = true

[dependencies]
sysmlv2-model = { path = "../sysmlv2-model", version = "0.5.5-rc.1" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.5.5-rc.1" }
sysmlv2-model = { path = "../sysmlv2-model", version = "0.6.0" }
sysmlv2-syntax = { path = "../sysmlv2-syntax", version = "0.6.0" }
serde_json.workspace = true

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion crates/sysmlv2-wasm/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,8 @@ fn render_view_accepts_plain_dom_parts_without_a_template_root() {
]);
let mut s = Session::from_sources(&src).unwrap();
assert_eq!(
s.render_view("BrowserViews::summary", Some("html".into())).unwrap(),
s.render_view("BrowserViews::summary", Some("html".into()))
.unwrap(),
"<article><h2>Overview</h2><p class=\"lead\">A rendered view.</p></article>"
);
}
1 change: 1 addition & 0 deletions spec-refs/SysML-v2-Release
Submodule SysML-v2-Release added at de1070
1 change: 1 addition & 0 deletions spec-refs/apollo-11-sysml-v2
Submodule apollo-11-sysml-v2 added at 6e9c93