1- name : CI & Release
1+ name : Release
22
33on :
44 pull_request :
55 push :
6- branches :
7- - dev
8- - main
96 tags :
107 - " core-v*"
118 - " express-v*"
129
1310jobs :
14- test :
15- name : Run Tests
16- runs-on : ubuntu-latest
17- if : github.event_name == 'pull_request'
18- steps :
19- - uses : actions/checkout@v4
20-
21- - uses : actions/setup-node@v4
22- with :
23- node-version : 20
24-
25- - name : Install express dependencies
26- working-directory : packages/express
27- run : npm install
28-
29- - name : Install core dependencies
30- working-directory : packages/core
31- run : npm install
32-
33- - name : Test Core
34- working-directory : packages/core
35- run : npm test
36-
37- - name : Test Express
38- working-directory : packages/express
39- run : npm test
40-
41- publish-express-beta :
42- name : Publish Express Beta
43- runs-on : ubuntu-latest
44- if : github.ref == 'refs/heads/dev'
45- permissions :
46- contents : write
47- id-token : write
48- steps :
49- - uses : actions/checkout@v4
50-
51- - uses : actions/setup-node@v4
52- with :
53- node-version : 20
54- registry-url : https://registry.npmjs.org/
55-
56- - name : Install dependencies
57- working-directory : packages/express
58- run : npm ci
59-
60- - name : Build
61- working-directory : packages/express
62- run : npm run build
63-
64- - name : Bump beta version
65- working-directory : packages/express
66- run : |
67- git config user.name "github-actions[bot]"
68- git config user.email "github-actions[bot]@users.noreply.github.com"
69- npm version prerelease --preid=beta
70- git push --follow-tags origin dev
71-
72- - name : Publish beta
73- working-directory : packages/express
74- run : npm publish --tag beta --access public
75- env :
76- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
77-
78- publish-core-beta :
79- name : Publish Core Beta
80- runs-on : ubuntu-latest
81- if : github.ref == 'refs/heads/dev'
82- permissions :
83- contents : write
84- id-token : write
85- steps :
86- - uses : actions/checkout@v4
87-
88- - uses : actions/setup-node@v4
89- with :
90- node-version : 20
91- registry-url : https://registry.npmjs.org/
92-
93- - name : Install dependencies
94- working-directory : packages/core
95- run : npm ci
96-
97- - name : Build
98- working-directory : packages/core
99- run : npm run build
100-
101- - name : Bump beta version
102- working-directory : packages/core
103- run : |
104- git config user.name "github-actions[bot]"
105- git config user.email "github-actions[bot]@users.noreply.github.com"
106- npm version prerelease --preid=beta
107- git push --follow-tags origin dev
108-
109- - name : Publish beta
110- working-directory : packages/core
111- run : npm publish --tag beta --access public
112- env :
113- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
11411 publish-stable :
11512 name : Publish Stable Release
11613 runs-on : ubuntu-latest
117- if : startsWith(github.ref, 'refs/tags/')
14+ if : startsWith(github.ref, 'refs/tags/core-v') || startsWith(github.ref, 'refs/tags/express-v ')
11815 permissions :
119- contents : write
16+ contents : read
12017 id-token : write
18+
12119 steps :
12220 - uses : actions/checkout@v4
12321
@@ -129,11 +27,12 @@ jobs:
12927 - name : Determine package
13028 id : pkg
13129 run : |
132- if [[ "${GITHUB_REF}" == refs/tags/core-* ]]; then
30+ if [[ "${GITHUB_REF}" == refs/tags/core-v * ]]; then
13331 echo "package=core" >> $GITHUB_OUTPUT
134- elif [[ "${GITHUB_REF}" == refs/tags/express-* ]]; then
32+ elif [[ "${GITHUB_REF}" == refs/tags/express-v * ]]; then
13533 echo "package=express" >> $GITHUB_OUTPUT
13634 else
35+ echo "Unknown tag format"
13736 exit 1
13837 fi
13938
14544 working-directory : packages/${{ steps.pkg.outputs.package }}
14645 run : npm run build
14746
148- - name : Publish stable
47+ - name : Publish stable to npm
14948 working-directory : packages/${{ steps.pkg.outputs.package }}
15049 run : npm publish --access public
15150 env :
0 commit comments