Skip to content

chore: remove parseArgs for compatibility #4

chore: remove parseArgs for compatibility

chore: remove parseArgs for compatibility #4

Workflow file for this run

name: Publish to npm
on:
push:
branches:
- main # Run when a push is made to the main branch
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org/"
scope: "@bytebase"
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Update package.json for npm publishing
run: |
# Get the current version from package.json
CURRENT_VERSION=$(jq -r '.version' package.json)
# Generate a version
VERSION="${CURRENT_VERSION}"
# Update package.json to use @bytebase scope and set version
jq --arg version "$VERSION" '.name = "@bytebase/dbhub" | .version = $version' package.json > package.json.tmp
mv package.json.tmp package.json
# Set files to include in the package
jq '.files = ["dist/**/*", "LICENSE", "README.md"]' package.json > package.json.tmp
mv package.json.tmp package.json
# Add bin entry for CLI usage
jq '.bin = {"dbhub": "dist/index.js"}' package.json > package.json.tmp
mv package.json.tmp package.json
- name: Publish to npm
run: pnpm publish --no-git-checks --access public --tag dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}