Skip to content

Commit 3161d2e

Browse files
authored
Create npm-publish.yml
1 parent 3099553 commit 3161d2e

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish package to NPM
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 18
17+
registry-url: https://registry.npmjs.org/
18+
19+
- run: yarn
20+
- run: yarn build
21+
- run: yarn publish --access=public --tag=next
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
25+
- name: Get package info
26+
id: package
27+
uses: codex-team/[email protected]
28+
29+
- name: Add LATEST tag for the published package if this is not a -rc version
30+
if: steps.package.outputs.is-release-candidate == 'false'
31+
run: npm dist-tag add ${{ steps.package.outputs.name }}@${{ steps.package.outputs.version }} latest
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
34+
35+
# notify:
36+
# needs: publish
37+
# runs-on: ubuntu-latest
38+
# steps:
39+
# - uses: actions/checkout@v2
40+
# - name: Get package info
41+
# id: package
42+
# uses: codex-team/action-nodejs-package-info@v1
43+
# - name: Send a message
44+
# uses: codex-team/action-codexbot-notify@v1
45+
# with:
46+
# webhook: ${{ secrets.CODEX_BOT_WEBHOOK_FRONTEND }}
47+
# message: '📦 [${{ steps.package.outputs.name }}](${{ steps.package.outputs.npmjs-link }}) ${{ steps.package.outputs.version }} was published'
48+
# parse_mode: 'markdown'
49+
# disable_web_page_preview: true

0 commit comments

Comments
 (0)