diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 25ea036..8b42f9f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -49,34 +49,46 @@ jobs: needs: distribute runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - + uses: actions/checkout@v4 with: ref: master # Otherwise it defaults to the version tag missing bump commit fetch-depth: 0 # Fetch all history - - name: Checkout to bump commit + - + name: Checkout to bump commit run: git checkout "$(git rev-list "${{ github.event.release.tag_name }}"..master | tail -1)" - - run: | - mkdir "../artifact" - cp -r . "../artifact" - rm -rf "../artifact/.git" - rm -rf "../artifact/.github" - rm -rf "../artifact/node_modules" - - uses: actions/upload-artifact@v1 + - + name: Create dist folder + run: | + mkdir "/tmp/package-dist" + cp -r . "/tmp/package-dist" + rm -rf "/tmp/package-dist/.git" + rm -rf "/tmp/package-dist/.github" + rm -rf "/tmp/package-dist/node_modules" + - + name: Upload dist folder + uses: actions/upload-artifact@v4 with: - name: package - path: ../artifact + name: npm-artifact + path: /tmp/package-dist publish-package: needs: create-package runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 + - + uses: actions/setup-node@v4 with: node-version: 22.x registry-url: https://registry.npmjs.org/ - - uses: actions/download-artifact@v1 + - + name: Download npm artifact + uses: actions/download-artifact@v4 with: - name: package - - run: cd package && npm publish + name: npm-artifact + path: npm-dist + - + name: Publish npm package + run: cd npm-dist && npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}