enables to specify wasm dir #22
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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "packages/core/package.json" | |
| - "packages/core/src/**" | |
| - ".github/workflows/publish_npm.yml" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/core | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm to latest version | |
| run: npm install -g npm@latest | |
| - name: Authenticate with npm | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Update version with build number | |
| run: | | |
| # Get current version from package.json | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| # Extract major and minor version (first two parts) | |
| MAJOR_MINOR=$(echo $CURRENT_VERSION | cut -d. -f1-2) | |
| # Set new version with GitHub run number as patch version | |
| NEW_VERSION="${MAJOR_MINOR}.${{ github.run_number }}" | |
| echo "Setting version to: $NEW_VERSION" | |
| npm version $NEW_VERSION --no-git-tag-version | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Publish to npm | |
| run: npm publish --access=public | |
| - name: Get published version | |
| id: version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Summary | |
| run: | | |
| echo "### ✅ Published to npm" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version:** ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Package:** $(node -p "require('./package.json').name")" >> $GITHUB_STEP_SUMMARY |