-
Notifications
You must be signed in to change notification settings - Fork 125
51 lines (39 loc) · 1.05 KB
/
release.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
42
43
44
45
46
47
48
49
50
51
name: Publish Package to npmjs
on:
workflow_dispatch:
repository_dispatch:
types: [ release ]
push:
tags: ["*"]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 #Setup Node
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: |
npm ci
- name: Lint
run: |
npm run lint
- name: Build
run: |
npm run build
- name: Publish
run: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }} npm publish ./ --access public
- name: Get tag
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Show new version
run: |
VERSION=${{ steps.get_version.outputs.version }}
PACKAGE_NAME="jodit-react"
echo "[New version npm](https://www.npmjs.com/package/${PACKAGE_NAME}/v/${VERSION})" >> $GITHUB_STEP_SUMMARY