-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.43 KB
/
main.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
52
53
54
55
56
57
58
name: Npm publish
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
on:
push:
branches:
- main
jobs:
Publish:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GIT_HUB_TOKEN }}
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- run: pnpm i --no-frozen-lockfile
- name: Config Git
run: |
git config --local user.name "bot"
git config --local user.email "[email protected]"
- name: Publish to npm
run: |
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
pnpm -r publish --access public --no-git-checks
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: Update readme
run: |
node tools/update-readme.js
git commit -am '[skip ci] update readme'
git tag v${{ steps.package-version.outputs.current-version}}
- name: Push Readme
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GIT_HUB_TOKEN }}
branch: ${{ github.ref }}
tags: true