chore: bump version to 1.3.0 #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to npm | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g. 1.0.0). Leave empty to use current package.json version.' | |
| required: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Set version from tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| elif [ -n "${{ github.event.inputs.version }}" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| else | |
| VERSION=$(node -p "require('./packages/cli/package.json').version") | |
| fi | |
| echo "Publishing version: $VERSION" | |
| # Update version in all package.json files | |
| node -e " | |
| const fs = require('fs'); | |
| ['packages/core/package.json', 'packages/cli/package.json'].forEach(f => { | |
| const pkg = JSON.parse(fs.readFileSync(f, 'utf-8')); | |
| pkg.version = '$VERSION'; | |
| fs.writeFileSync(f, JSON.stringify(pkg, null, 2) + '\n'); | |
| }); | |
| " | |
| - name: Build | |
| run: pnpm build | |
| - name: Publish to npm | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| pnpm publish --filter @juliantanx/aiusage --no-git-checks --access public |