Try publishing with package.json config (#139) #15
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: Release | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Read .nvmrc | |
| run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
| id: nvm | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ steps.nvm.outputs.NVMRC }} | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build Packages | |
| run: npm run build | |
| - name: Get Artifact Publish Token | |
| id: publish-token | |
| uses: atlassian-labs/artifact-publish-token@v1.0.1 | |
| with: | |
| output-modes: npm | |
| - name: Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: npm run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # Use the config file generated by atlassian-labs/artifact-publish-token | |
| NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc-public |