diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68deec6..6a8af17 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,18 +15,28 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm + + - id: dist-tag + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + return /^refs\/tags\/v\d+\.\d+\.\d+$/.test(context.ref) ? "latest" : "next" + - name: npm publish run: | echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc npm whoami npm ci npm run bootstrap - npm publish --access=public --workspace="packages/prisma-fabbrica" + npm publish --access=public --tag ${{ steps.dist-tag.outputs.result }} --workspace="packages/prisma-fabbrica" if: contains(github.ref, 'tags/v') env: NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}