Skip to content

Commit 177fa72

Browse files
committed
Fix release workflow to install package before test
1 parent 063d394 commit 177fa72

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

.github/workflows/release-package.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,46 @@ on:
55
types: [created]
66

77
jobs:
8-
build:
8+
test:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v2
13+
with:
14+
version: 9
1215
- uses: actions/setup-node@v4
1316
with:
14-
node-version: 20
15-
- run: npm install -g pnpm
16-
- run: pnpm test
17-
17+
node-version: "20"
18+
cache: "pnpm"
19+
- run: pnpm install
20+
- run: |
21+
npx puppeteer browsers install chrome
22+
- name: Run test
23+
run: |
24+
for i in {1..3}; do
25+
echo "Attempt $i"
26+
if pnpm test:google; then
27+
echo "Success on attempt $i"
28+
exit 0
29+
fi
30+
echo "Attempt $i failed, retrying..."
31+
done
32+
echo "All attempts failed"
33+
exit 1
1834
publish:
19-
needs: build
35+
needs: test
2036
runs-on: ubuntu-latest
21-
permissions:
22-
packages: write
23-
contents: read
2437
steps:
2538
- uses: actions/checkout@v4
39+
- uses: pnpm/action-setup@v2
40+
with:
41+
version: 9
2642
- uses: actions/setup-node@v4
2743
with:
28-
node-version: 20
29-
registry-url: https://npm.pkg.github.com/
30-
- run: npm install -g pnpm
44+
node-version: "20"
45+
cache: "pnpm"
46+
- run: pnpm install
47+
- run: pnpm build
3148
- run: pnpm publish
3249
env:
3350
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)