Skip to content

Commit 634dd64

Browse files
committed
Release to npm and github when tagging
1 parent 997e90f commit 634dd64

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,37 @@ jobs:
9494

9595
- name: Push image
9696
run: docker push ghcr.io/${{ github.repository }}:latest
97+
98+
release:
99+
name: Release
100+
runs-on: ubuntu-latest
101+
needs: test
102+
if: startsWith(github.ref, 'refs/tags/v')
103+
permissions:
104+
contents: write
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v3
108+
with:
109+
fetch-depth: 0
110+
111+
- name: Use Node.js 18
112+
uses: actions/setup-node@v3
113+
with:
114+
node-version: '18'
115+
registry-url: 'https://registry.npmjs.org/'
116+
117+
- name: Install dependencies
118+
run: npm install
119+
120+
- name: Publish to npm
121+
run: npm publish --access public
122+
env:
123+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
124+
125+
- name: Create GitHub Release
126+
uses: softprops/action-gh-release@v2
127+
with:
128+
generate_release_notes: true
129+
env:
130+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)