Skip to content

Commit c9ca350

Browse files
authored
Auto-publish tag builds to npm (#66)
1 parent 8c1a61d commit c9ca350

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/ci.yml

+28
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,31 @@ jobs:
8888
run: |
8989
npm i -g ${{ needs.build.outputs.artifact_filename }}
9090
npx create-rescript-app
91+
92+
publish:
93+
needs: [build, test]
94+
95+
if: startsWith(github.ref, 'refs/tags/v')
96+
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v4
102+
103+
- name: Use Node.js
104+
uses: actions/setup-node@v4
105+
with:
106+
node-version: 18
107+
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
108+
109+
- name: Download artifacts
110+
uses: actions/download-artifact@v4
111+
with:
112+
name: ${{ needs.build.outputs.artifact_filename }}
113+
114+
- name: Publish packages on npm with tag "ci"
115+
env:
116+
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
117+
run: |
118+
npm publish ${{ needs.build.outputs.artifact_filename }} --tag ci

0 commit comments

Comments
 (0)