-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.21 KB
/
cd.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
name: cd
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Configure git
run: |
git config --global user.name "${{ secrets.GIT_NAME }}"
git config --global user.email "${{ secrets.GIT_EMAIL }}"
- name: Update version in package.json
run: pnpm version ${{ github.ref_name }} --allow-same-version
- name: Configure npm client for publish
run: pnpm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
- name: Publish package to npmjs.com
run: pnpm publish --no-git-checks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push updates to repo
run: git push
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}