-
Notifications
You must be signed in to change notification settings - Fork 337
46 lines (37 loc) · 1.1 KB
/
Copy pathpublish-any-commit.yml
File metadata and controls
46 lines (37 loc) · 1.1 KB
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: Publish Any Commit
on: [push, pull_request]
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Publish packages (retry on transient failures)
run: |
max_attempts=4
attempt=1
while [ "$attempt" -le "$max_attempts" ]; do
if pnpm dlx pkg-pr-new publish \
./packages/react-grab \
./packages/cli \
./packages/grab; then
exit 0
fi
if [ "$attempt" -eq "$max_attempts" ]; then
exit 1
fi
sleep_seconds=$((2 ** attempt))
echo "pkg-pr-new publish failed on attempt ${attempt}/${max_attempts}; retrying in ${sleep_seconds}s..."
sleep "$sleep_seconds"
attempt=$((attempt + 1))
done