Skip to content

chore(sdk): switch to unscoped name chronos-synapse-sdk and bump to 0… #3

chore(sdk): switch to unscoped name chronos-synapse-sdk and bump to 0…

chore(sdk): switch to unscoped name chronos-synapse-sdk and bump to 0… #3

Workflow file for this run

name: Publish SDK
on:
push:
tags:
- 'sdk-v*'
permissions:
contents: read
packages: write
jobs:
publish:
name: Publish SDK (chronos-synapse-sdk)
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Set package version from tag (skip if same)
run: |
VERSION="${GITHUB_REF_NAME#sdk-v}"
CURRENT=$(node -p "require('./package.json').version")
echo "Version from tag: $VERSION (current: $CURRENT)"
if [ "$CURRENT" != "$VERSION" ]; then
npm version "$VERSION" --no-git-tag-version
else
echo "Version unchanged; skipping bump"
fi
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}