-
Notifications
You must be signed in to change notification settings - Fork 23
97 lines (87 loc) · 3.44 KB
/
Copy pathrelease-package.yml
File metadata and controls
97 lines (87 loc) · 3.44 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release Package
on:
release:
types: [created]
jobs:
test:
runs-on: ubuntu-22.04
env:
##########################################################################
# App Config
##########################################################################
NEXT_PUBLIC_URL: "http://localhost:3000"
DATABASE_URI: "file:./payload-oauth2.db"
PAYLOAD_SECRET: "hellohereisasecretforyou"
##########################################################################
# Test Config
##########################################################################
# Optional: Set to "true" to run test browser in headless mode
HEADLESS: true
##########################################################################
# Google OAuth Config
##########################################################################
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
##########################################################################
# Google Test Account
##########################################################################
# Required: Google Test Account Email
GOOGLE_TEST_EMAIL: ${{ secrets.GOOGLE_TEST_EMAIL }}
# Required: Google Test Account Password
GOOGLE_TEST_PASSWORD: ${{ secrets.GOOGLE_TEST_PASSWORD }}
##########################################################################
# Zitadel OAuth Config
##########################################################################
ZITADEL_CLIENT_ID: ${{ secrets.ZITADEL_CLIENT_ID }}
ZITADEL_CLIENT_SECRET: ${{ secrets.ZITADEL_CLIENT_SECRET }}
ZITADEL_TOKEN_ENDPOINT: ${{ secrets.ZITADEL_TOKEN_ENDPOINT }}
ZITADEL_AUTHORIZATION_URL: ${{ secrets.ZITADEL_AUTHORIZATION_URL }}
ZITADEL_USERINFO_ENDPOINT: ${{ secrets.ZITADEL_USERINFO_ENDPOINT }}
##########################################################################
# Zitadel Test Account
##########################################################################
# Required: Zitadel Test Account Email
ZITADEL_TEST_EMAIL: ${{ secrets.ZITADEL_TEST_EMAIL }}
# Required: Zitadel Test Account Password
ZITADEL_TEST_PASSWORD: ${{ secrets.ZITADEL_TEST_PASSWORD }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: pnpm install
- run: |
npx puppeteer browsers install chrome
- name: Run test
run: |
for i in {1..3}; do
echo "Attempt $i"
if pnpm test; then
echo "Success on attempt $i"
exit 0
fi
echo "Attempt $i failed, retrying..."
done
echo "All attempts failed"
exit 1
publish:
needs: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- name: Configure npm access token via .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- run: pnpm publish --access public --no-git-checks