Skip to content

Commit 21584d3

Browse files
committed
ci: use pnpm for ci
1 parent fec4700 commit 21584d3

File tree

2 files changed

+39
-29
lines changed

2 files changed

+39
-29
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [14.x]
21+
node-version: [16.x]
2222

2323
steps:
2424
# Setup
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Node ${{ matrix.node_version }}
2828
uses: actions/setup-node@v1
2929
with:
30-
node-version: 14
30+
node-version: 16
3131
registry-url: 'https://registry.npmjs.org'
3232
- name: Git Identity
3333
run: |
@@ -77,15 +77,22 @@ jobs:
7777
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878

7979
# Bootstrap project
80+
- name: Cache pnpm modules
81+
uses: actions/cache@v3
82+
with:
83+
path: ~/.pnpm-store
84+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
85+
restore-keys: |
86+
${{ runner.os }}-
8087
- name: install
81-
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
82-
run: yarn
83-
- name: bootstrap
84-
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
85-
run: yarn run bootstrap
88+
uses: pnpm/[email protected]
89+
with:
90+
version: 8
91+
run_install: |
92+
- recursive: true
93+
args: [--frozen-lockfile]
8694
- name: build
87-
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
88-
run: yarn build
95+
run: pnpm build
8996

9097
# Git stash
9198
- name: Drop current changes
@@ -106,9 +113,13 @@ jobs:
106113
git_tag_prefix: "v"
107114

108115
# Publish
109-
- name: npm publish
110-
if: steps.tag_check.outputs.exists_tag == 'false' && startsWith( env.commitmsg , 'chore(release):' )
111-
run: yarn lerna publish from-package --yes
116+
- name: Publish
117+
run: |
118+
if [ '${{ github.event_name }}' == 'pull_request' ] ; then
119+
pnpm publish --registry=https://registry.npmjs.org/ --publish-branch=${{ github.ref }} -r
120+
elif [ '${{ github.event_name }}' == 'push' ] ; then
121+
pnpm publish --registry=https://registry.npmjs.org/ --publish-branch=${{ github.ref_name }} -r ${{ env.PUBLISH_PARAMS }}
122+
fi
112123
env:
113124
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114125
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/rn-release.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,23 @@ jobs:
1616
path: ${{ github.workspace }}/node_modules
1717
key: ${{ runner.os }}-node_modules
1818
restore-keys: ${{ runner.os }}-node_modules
19-
- name: Get Yarn Cache Directory Path
20-
id: yarn-cache-dir-path
21-
run: echo "::set-output name=dir::$(yarn cache dir)"
22-
- name: Cache Yarn
23-
uses: actions/cache@v2
24-
env:
25-
cache-name: yarn-cache
19+
20+
- name: Cache pnpm modules
21+
uses: actions/cache@v3
2622
with:
27-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
23+
path: ~/.pnpm-store
24+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2925
restore-keys: |
30-
${{ runner.os }}-yarn-
31-
- name: Install Dependencies
32-
run: |
33-
yarn
34-
- name: Lerna Bootstrap
35-
run: |
36-
yarn bootstrap
26+
${{ runner.os }}-
27+
28+
- name: install
29+
uses: pnpm/[email protected]
30+
with:
31+
version: 8
32+
run_install: |
33+
- recursive: true
34+
args: [--frozen-lockfile]
35+
3736
- name: Release Taro React Native bundle
3837
uses: zhiqingchen/taro-react-native-release@v1
3938
with:
@@ -47,4 +46,4 @@ jobs:
4746
name: bundle-qr-code
4847
path: |
4948
packages/taro-ui-demo-rn/release/qrcode/ios.png
50-
packages/taro-ui-demo-rn/release/qrcode/android.png
49+
packages/taro-ui-demo-rn/release/qrcode/android.png

0 commit comments

Comments
 (0)