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
85 changes: 85 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Publish npm packages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
id-token: write

concurrency:
group: npm-publish
cancel-in-progress: false

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
if: >-
github.event_name == 'workflow_dispatch' ||
contains(github.event.head_commit.message, '[deploy]')
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Use npm 11 for trusted publishing
run: npm install -g npm@11

- run: npm ci

- name: Audit production dependencies
run: npm audit --omit=dev --audit-level=moderate

- name: Check package versions
shell: bash
run: |
set -euo pipefail
js_version=$(node -p "require('./packages/flint-js/package.json').version")
mcp_version=$(node -p "require('./packages/flint-mcp/package.json').version")

if npm view "flint-chart@${js_version}" version >/dev/null 2>&1; then
echo "::error::flint-chart@${js_version} is already published. Bump the package version before deploying."
exit 1
fi

if npm view "flint-chart-mcp@${mcp_version}" version >/dev/null 2>&1; then
echo "::error::flint-chart-mcp@${mcp_version} is already published. Bump the package version before deploying."
exit 1
fi

echo "js_version=${js_version}" >> "$GITHUB_ENV"
echo "mcp_version=${mcp_version}" >> "$GITHUB_ENV"

- name: Publish flint-chart
run: npm publish --workspace packages/flint-js --access public

- name: Wait for flint-chart to resolve
shell: bash
run: |
set -euo pipefail
for attempt in {1..30}; do
if npm view "flint-chart@${js_version}" version >/dev/null 2>&1; then
npm view "flint-chart@${js_version}" version
exit 0
fi
echo "Waiting for flint-chart@${js_version} to be visible on npm (${attempt}/30)..."
sleep 10
done
echo "::error::flint-chart@${js_version} did not become visible on npm in time."
exit 1

- name: Publish flint-chart-mcp
run: npm publish --workspace packages/flint-mcp --access public

- name: Verify published packages
run: |
npm dist-tag ls flint-chart
npm dist-tag ls flint-chart-mcp
npm view "flint-chart@${js_version}" name version license repository.url
npm view "flint-chart-mcp@${mcp_version}" name version license repository.url bin
6 changes: 3 additions & 3 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/flint-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flint-chart",
"version": "0.1.0",
"version": "0.1.1",
"description": "Semantic-level visualization library that compiles data + semantic types into chart specs for Vega-Lite, ECharts, and Chart.js.",
"keywords": [
"visualization",
Expand All @@ -15,7 +15,7 @@
],
"license": "MIT",
"author": "Microsoft Corporation",
"homepage": "https://github.com/microsoft/flint-chart#readme",
"homepage": "https://microsoft.github.io/flint-chart/",
"repository": {
"type": "git",
"url": "git+https://github.com/microsoft/flint-chart.git",
Expand Down
6 changes: 3 additions & 3 deletions packages/flint-mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flint-chart-mcp",
"version": "0.1.0",
"version": "0.1.1",
"description": "Model Context Protocol server for Flint — compile, validate, and render semantic chart specs to Vega-Lite, ECharts, or Chart.js artifacts (PNG/SVG) in-process.",
"keywords": [
"mcp",
Expand All @@ -17,7 +17,7 @@
],
"license": "MIT",
"author": "Microsoft Corporation",
"homepage": "https://github.com/microsoft/flint-chart/tree/main/packages/flint-mcp#readme",
"homepage": "https://microsoft.github.io/flint-chart/",
"repository": {
"type": "git",
"url": "git+https://github.com/microsoft/flint-chart.git",
Expand Down Expand Up @@ -69,7 +69,7 @@
"canvas": "^3.2.3",
"chart.js": "^4.4.0",
"echarts": "^6.0.0",
"flint-chart": "^0.1.0",
"flint-chart": "^0.1.1",
"vega": "^6.0.0",
"vega-interpreter": "^2.2.1",
"vega-lite": "^6.0.0",
Expand Down
Loading