Skip to content

Commit

Permalink
Auto-publish tag builds to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
cknitt committed Jun 16, 2024
1 parent 8c1a61d commit 1b160cd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,31 @@ jobs:
run: |
npm i -g ${{ needs.build.outputs.artifact_filename }}
npx create-rescript-app
publish:
needs: [build, test]

if: startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_filename }}

- name: Publish packages on npm with tag "ci"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm publish ${{ needs.build.outputs.artifact_filename }} --tag ci

0 comments on commit 1b160cd

Please sign in to comment.