-
Notifications
You must be signed in to change notification settings - Fork 268
61 lines (52 loc) · 1.81 KB
/
publish.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
59
60
61
name: PNPM Create PR or Publish
on:
push:
branches:
- master
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
release:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
# This makes action fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
#Install pnpm
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 7.28.0
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: Install
run: pnpm install
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Set Username
run: git config --global user.name "GitHub CD bot"
- name: Set Email
run: git config --global user.email "[email protected]"
- name: Build
run: pnpm run build
# run tests just in case
- name: Test
run: pnpm vitest --run
# Publish using changeset
- name: create PR or publish
uses: changesets/action@v1
with:
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}