-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (33 loc) · 1.08 KB
/
new-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "New Version Actions"
on:
push:
branches: # only trigger when a commit was pushed to main
- main
permissions:
# Used by `create-release` to create a new release on the repo after publishing to npm.
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.0.0
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- id: publish-to-npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }} # This token should be added from repo settings
- id: create-gh-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.publish-to-npm.outputs.version }}
release_name: ${{ steps.publish-to-npm.outputs.version }}