Skip to content

Commit

Permalink
Merge pull request #329 from Quramy/publish_with_dist_tags
Browse files Browse the repository at this point in the history
chore(CI): Publish with npm dist tag
  • Loading branch information
Quramy authored Jun 14, 2024
2 parents c4b9830 + aeff9e5 commit b868476
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit b868476

Please sign in to comment.