Skip to content

Commit 882dc3c

Browse files
Merge branch 'master' into feature/prarii/1419
2 parents f9a4210 + f45fb7d commit 882dc3c

55 files changed

Lines changed: 694 additions & 812 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 91 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
required: true
1212
default: "v1.0.0"
1313
type: string
14-
14+
1515
env:
1616
HUSKY: 0
1717

@@ -22,13 +22,20 @@ permissions:
2222
jobs:
2323
publish:
2424
runs-on: ubuntu-24.04
25-
25+
2626
permissions:
2727
id-token: write # Required for OIDC trusted publishing
2828
contents: write
29+
pull-requests: write # Required to open the version-bump-back PR
30+
issues: write # peter-evans/create-pull-request needs this to apply labels when falling back to GITHUB_TOKEN
2931
steps:
3032
- name: Checkout code
3133
uses: actions/checkout@v6
34+
with:
35+
# Check out the release's target branch (typically master) so the
36+
# subsequent version-bump commit is based on the branch HEAD, not on
37+
# the tag's detached commit. Falls back to master for workflow_dispatch.
38+
ref: ${{ github.event.release.target_commitish || 'master' }}
3239

3340
- name: Setup Node.js
3441
uses: actions/setup-node@v6
@@ -38,18 +45,95 @@ jobs:
3845
scope: "@sistent"
3946

4047
- name: "Set Package Version"
41-
uses: reedyuk/npm-version@1.1.1
42-
with:
43-
version: ${{ github.event.release.tag_name || inputs.tag_name }}
48+
env:
49+
TAG_NAME: ${{ github.event.release.tag_name || inputs.tag_name }}
50+
run: |
51+
# Strip a leading 'v' from the release tag (v0.19.0 -> 0.19.0) and
52+
# set package.json#version. --allow-same-version makes the step
53+
# idempotent when master's package.json already matches the tag
54+
# (i.e., the PR this bump-back step opens has already been merged
55+
# before the next release is cut). --no-git-tag-version prevents
56+
# npm from creating an extra tag.
57+
VERSION="${TAG_NAME#v}"
58+
npm version "$VERSION" --no-git-tag-version --allow-same-version
59+
60+
- name: "Resolve normalized version"
61+
id: resolved_version
62+
env:
63+
RAW_VERSION: ${{ github.event.release.tag_name || inputs.tag_name }}
64+
run: |
65+
set -euo pipefail
66+
# Strip leading 'v' to match what the "Set Package Version" step writes into package.json.
67+
normalized="${RAW_VERSION#v}"
68+
if [ -z "$normalized" ]; then
69+
echo "Could not resolve a normalized version from '$RAW_VERSION'." >&2
70+
exit 1
71+
fi
72+
echo "version=$normalized" >> "$GITHUB_OUTPUT"
73+
echo "Resolved normalized version: $normalized"
4474
4575
- name: Install, Build, and Publish Package
76+
# Use `npm ci` so the install is strictly driven by the committed lockfile
77+
# and does not rewrite lockfile metadata beyond what `npm version` already
78+
# wrote to the root `packages[""].version` field. This keeps the bump-back
79+
# PR's diff scoped to the version change only, addressing the concern that
80+
# `npm install` could churn transitive dependency entries in the lockfile.
4681
run: |
47-
npm install --legacy-peer-deps
82+
npm ci --legacy-peer-deps
4883
npm run build
4984
npm publish --provenance --access public --verbose
5085
env:
5186
NODE_AUTH_TOKEN: '' # Explicitly empty for install
5287

88+
# --- Commit the package.json / package-lock.json version bump back to the
89+
# release's target branch (typically master) so the branch's on-disk
90+
# version tracks what was actually published to npm. Without this step,
91+
# master drifts behind npm indefinitely (e.g., master was pinned at
92+
# 0.16.5 while npm had published v0.18.8) which confuses contributors
93+
# branching off master.
94+
#
95+
# master has branch protection requiring 1 PR approval, and the
96+
# github-actions[bot] identity is NOT in the bypass_pull_request_allowances
97+
# list, so a direct push would be rejected. The cross-repo dependent
98+
# bumps in notify-dependents.yml already use peter-evans/create-pull-request
99+
# for the same reason — we follow that established pattern here.
100+
#
101+
# continue-on-error: true keeps npm publish success the source of truth
102+
# for the workflow's overall conclusion. If the bump-back PR fails to
103+
# open for any reason (API rate-limit, transient GitHub outage, etc.),
104+
# the publish job still succeeds, which means notify-dependents.yml
105+
# (triggered on workflow_run success) still fires and updates the
106+
# downstream consumers. A maintainer can always open the bump-back PR
107+
# manually if the automated step is skipped.
108+
- name: Open PR with package.json version bump
109+
if: ${{ success() }}
110+
continue-on-error: true
111+
uses: peter-evans/create-pull-request@v8
112+
with:
113+
token: ${{ secrets.GH_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
114+
commit-message: |
115+
chore(release): bump package.json to v${{ steps.resolved_version.outputs.version }} [skip ci]
116+
committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
117+
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
118+
signoff: true
119+
branch: release/version-bump/v${{ steps.resolved_version.outputs.version }}
120+
base: ${{ github.event.release.target_commitish || 'master' }}
121+
delete-branch: true
122+
title: "chore(release): bump package.json to v${{ steps.resolved_version.outputs.version }}"
123+
add-paths: |
124+
package.json
125+
package-lock.json
126+
body: |
127+
Bumps `package.json` and `package-lock.json` to `v${{ steps.resolved_version.outputs.version }}` to match the version just published to npm.
128+
129+
This PR is auto-generated by the `Publish Node.js Package` workflow after a successful `npm publish --provenance` so that the target branch tracks the published npm version rather than drifting behind it indefinitely. Historically this drift has confused contributors branching off `master` (e.g., `master` was at `0.16.5` while npm had published `v0.18.8`).
130+
131+
The commit message includes `[skip ci]` so merging this PR does not re-trigger workflows against the bump commit — the content was already CI-gated by the PR that merged into the tag.
132+
labels: |
133+
chore
134+
release
135+
draft: false
136+
53137
notify-dependents:
54138
needs: publish
55139
runs-on: ubuntu-24.04
@@ -62,4 +146,4 @@ jobs:
62146
result-encoding: string
63147
script: |
64148
let release_version = `${{github.event.release.tag_name}}`
65-
return release_version.replace(/^v/, '')
149+
return release_version.replace(/^v/, '')

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The Sistent Design System provides the open source building blocks to design and implement consistent, accessible, and delightful product experiences. Visit the <a href="https://layer5.io/projects/sistent">project website</a> for more information.
44

5+
## Naming conventions
6+
7+
Sistent components that surface API data (tables, form fields, charts) must use the camelCase-on-the-wire identifiers defined by the Meshery / Layer5 ecosystem contract. See the [identifier-naming contributor guide](https://github.com/meshery/schemas/blob/master/docs/identifier-naming-contributor-guide.md) in `meshery/schemas` — the reader-friendly 26-row naming directory with before/after and do/don't examples — before adding props, column keys, or query-arg types that map to a Meshery or Layer5 Cloud response shape.
8+
59
## Contributing to Sistent
610

711
### Prerequisites

0 commit comments

Comments
 (0)