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

on:
push:
tags:
- 'cli-[0-9]+.[0-9]+.[0-9]+'

permissions: {}

jobs:
publish:
name: Publish @stakewise/create-vault-interface
runs-on: ubuntu-latest
environment:
name: npm-publish-cli
url: https://www.npmjs.com/package/@stakewise/create-vault-interface
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
with:
version: 10.25.0

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
cache: pnpm
node-version: '24.12.0'
registry-url: 'https://registry.npmjs.org'

- name: Verify tag matches cli/package.json version
run: |
TAG_VERSION="${GITHUB_REF_NAME#cli-}"
PKG_VERSION=$(node -p "require('./cli/package.json').version")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag $GITHUB_REF_NAME (parsed as $TAG_VERSION) does not match cli/package.json version $PKG_VERSION"
exit 1
fi

- name: Verify tag is on main
run: |
git fetch origin main --depth=1
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "::error::Tag $GITHUB_REF_NAME points to commit $GITHUB_SHA which is not on main branch"
exit 1
fi

- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Build CLI
working-directory: cli
run: pnpm build

- name: Publish to npm with provenance
working-directory: cli
run: npm publish --provenance --access public --ignore-scripts
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stakewise/create-vault-interface",
"version": "0.1.4",
"version": "0.1.5",
"description": "CLI for creating a StakeWise Vault Interface application",
"type": "module",
"scripts": {
Expand Down
Loading