-
Notifications
You must be signed in to change notification settings - Fork 20
37 lines (35 loc) · 1.21 KB
/
npm.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
name: npm
on:
push:
tags:
- "*"
jobs:
publish:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: "https://registry.npmjs.org"
always-auth: true
- run: corepack enable
- run: yarn install
- run: yarn build
- run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- run: echo ${RELEASE_VERSION}
- name: publish
run: |
git config --global user.email "${GITHUB_ACTOR}"
git config --global user.name "${GITHUB_ACTOR}"
yarn publish --access public --new-version ${RELEASE_VERSION}
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Generate changelog
run: |
git-chglog --output CHANGELOG.md $GITHUB_REF_NAME
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md