workflow fixes #13
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: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
| jobs: | ||
| publish: | ||
| name: Publish to npm | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 20 | ||
| registry-url: https://registry.npmjs.org/ | ||
| - name: Setup Rust | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| profile: minimal | ||
| override: true | ||
| - name: Install dependencies | ||
| run: | | ||
| npm install -g npm@latest | ||
| npm install -g @napi-rs/cli | ||
| npm install | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Prepare for publish | ||
| run: npm run prepublishOnly | ||
| working-directory: crates/rexprs-js | ||
| - name: Publish to npm | ||
| id: changesets | ||
| uses: changesets/action@v1 | ||
| with: | ||
| publish: npm publish --access public | ||
| env: | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| working-directory: crates/rexprs-js | ||