Skip to content

Commit b93414b

Browse files
committed
build: Added nx and publish workflow
1 parent e960a84 commit b93414b

File tree

5 files changed

+8150
-947
lines changed

5 files changed

+8150
-947
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
jobs:
9+
publish:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
15+
timeout-minutes: 10
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: pnpm/action-setup@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: https://registry.npmjs.org/
27+
cache: "pnpm"
28+
29+
- run: pnpm install --frozen-lockfile
30+
31+
- run: pnpm exec nx run-many -t build
32+
33+
- run: pnpm exec nx report
34+
shell: bash
35+
36+
- run: pnpm exec nx release publish
37+
shell: bash
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
40+
NPM_CONFIG_PROVENANCE: true

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,12 @@ dev/generated-schema.graphql
247247
dist
248248

249249
dev/src/uploads
250+
251+
252+
253+
.nx/cache
254+
.nx/workspace-data
255+
256+
# Next.js
257+
.next
258+
out

nx.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"targetDefaults": {
4+
"dev": {
5+
"outputs": [
6+
"{projectRoot}/dev/.next"
7+
],
8+
"cache": true
9+
},
10+
"build": {
11+
"outputs": [
12+
"{projectRoot}/dist"
13+
],
14+
"cache": true
15+
},
16+
"test": {
17+
"cache": true
18+
},
19+
"lint": {
20+
"cache": true
21+
},
22+
"dev:lint": {
23+
"cache": true
24+
},
25+
"lint:fix": {
26+
"cache": false
27+
}
28+
},
29+
"defaultBase": "main",
30+
"plugins": [
31+
{
32+
"plugin": "@nx/eslint/plugin",
33+
"options": {
34+
"targetName": "eslint:lint"
35+
}
36+
},
37+
{
38+
"plugin": "@nx/jest/plugin",
39+
"options": {
40+
"targetName": "test"
41+
}
42+
},
43+
{
44+
"plugin": "@nx/next/plugin",
45+
"options": {
46+
"startTargetName": "start",
47+
"buildTargetName": "build",
48+
"devTargetName": "dev",
49+
"serveStaticTargetName": "serve-static"
50+
}
51+
}
52+
],
53+
"release": {
54+
"version": {
55+
"conventionalCommits": true
56+
},
57+
"changelog": {
58+
"workspaceChangelog": {
59+
"createRelease": "github",
60+
"renderOptions": {
61+
"authors": false
62+
}
63+
}
64+
}
65+
}
66+
}

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@
3737
"payload": "beta"
3838
},
3939
"devDependencies": {
40+
"@nx/eslint": "19.6.4",
41+
"@nx/jest": "19.6.4",
42+
"@nx/js": "19.6.5",
43+
"@nx/next": "19.6.4",
4044
"@payloadcms/db-postgres": "3.0.0-beta.92",
4145
"@payloadcms/eslint-config": "^1",
4246
"@payloadcms/next": "3.0.0-beta.92",
4347
"@payloadcms/richtext-lexical": "3.0.0-beta.92",
4448
"@payloadcms/ui": "3.0.0-beta.92",
49+
"@swc-node/register": "~1.9.1",
50+
"@swc/core": "~1.5.7",
51+
"@swc/helpers": "~0.5.11",
4552
"@swc/jest": "^0.2.36",
4653
"@types/jest": "^29.5.12",
4754
"@types/jsonwebtoken": "^9.0.6",
@@ -59,10 +66,16 @@
5966
"jsonwebtoken": "^9.0.2",
6067
"next": "^15.0.0-canary.104",
6168
"nodemailer": "^6.9.14",
69+
"nx": "19.6.5",
6270
"payload": "3.0.0-beta.90",
6371
"prettier": "^3.3.3",
6472
"react": "19.0.0-rc-06d0b89e-20240801",
6573
"sharp": "^0.33.5",
6674
"typescript": "^5.5.4"
67-
}
68-
}
75+
},
76+
"nx": {},
77+
"dependencies": {
78+
"react-dom": "18.3.1"
79+
},
80+
"packageManager": "[email protected]"
81+
}

0 commit comments

Comments
 (0)