Skip to content

Commit 96d92d9

Browse files
chore: switch to nx [EXT-7081] (#2883)
* chore: switch to nx publishing [EXT-7081] * chore: remove lerna
1 parent 539c226 commit 96d92d9

14 files changed

Lines changed: 8859 additions & 8651 deletions

File tree

.github/actions/install-and-build/action.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,13 @@ runs:
2020
- name: Install Dependencies (Linux)
2121
if: inputs.os != 'windows-latest'
2222
shell: bash
23-
run: npm ci && npm run bootstrap
23+
run: npm ci
2424

2525
- name: Install Dependencies (Windows)
2626
if: inputs.os == 'windows-latest'
2727
shell: pwsh
2828
run: |
2929
npm ci
30-
if ($LASTEXITCODE -eq 0) {
31-
npm run bootstrap
32-
} else {
33-
exit $LASTEXITCODE
34-
}
35-
36-
- name: Disable Nx daemon
37-
if: inputs.os == 'windows-latest'
38-
shell: pwsh
39-
run: |
40-
"NX_DAEMON=false" | Out-File -FilePath $env:GITHUB_ENV -Append
41-
42-
- name: Nx reset
43-
if: inputs.os == 'windows-latest'
44-
shell: pwsh
45-
run: npx nx reset
4630
4731
- name: Build (Linux)
4832
if: inputs.os != 'windows-latest'

.github/workflows/release.yaml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,62 +72,51 @@ jobs:
7272
run: npm install -g npm@latest
7373

7474
- name: Install dependencies
75-
run: npm ci && npm run bootstrap
75+
run: npm ci
7676

7777
- name: Build
7878
run: npm run build
7979

80-
- name: Version (main branch)
80+
- name: Prepare release (main branch)
8181
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
82-
run: npm run version
82+
run: npm run prepare-release
8383
env:
84-
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
85-
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
86-
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
87-
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
8884
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
8985
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
9086
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
9187
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
9288

93-
- name: Publish (main branch)
94-
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
95-
run: npm run publish-packages
89+
- name: Prepare release (canary branch)
90+
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
91+
run: npm run prepare-release:canary
9692
env:
97-
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
98-
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
99-
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
100-
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
10193
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
10294
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
10395
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
10496
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
10597

106-
- name: Version (canary branch)
98+
- name: Push release commit + tags (canary)
10799
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
108-
run: npm run version:canary
100+
run: |
101+
git push --follow-tags --no-verify --atomic
102+
env:
103+
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
104+
105+
- name: Publish (main branch)
106+
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
107+
run: npm run publish-packages
109108
env:
110109
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
111-
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
112-
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
113110
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
114-
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
115-
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
116-
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
117-
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
111+
NPM_CONFIG_PROVENANCE: true
118112

119113
- name: Publish (canary branch)
120114
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
121115
run: npm run publish-packages:canary
122116
env:
123117
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
124-
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
125-
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
126118
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
127-
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
128-
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
129-
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
130-
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
119+
NPM_CONFIG_PROVENANCE: true
131120

132121
- name: Print lerna debug log
133122
if: always()

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
2+
@contentful:registry=https://registry.npmjs.org
23
ignore-scripts=true

nx.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
23
"tasksRunnerOptions": {
34
"default": {
45
"runner": "nx/tasks-runners/default",
@@ -17,5 +18,54 @@
1718
"^build"
1819
]
1920
}
21+
},
22+
"namedInputs": {
23+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
24+
"production": [
25+
"default",
26+
"!{projectRoot}/test/**/*",
27+
"!{projectRoot}/**/*.spec.ts",
28+
"!{projectRoot}/**/*.spec.tsx",
29+
"!{projectRoot}/**/*.spec.js",
30+
"!{projectRoot}/**/*.test.ts",
31+
"!{projectRoot}/**/*.test.tsx",
32+
"!{projectRoot}/**/*.test.js",
33+
"!{projectRoot}/jest.config.js",
34+
"!{projectRoot}/jest.config.ts",
35+
"!{projectRoot}/.eslintrc",
36+
"!{projectRoot}/.eslintrc.*",
37+
"!{projectRoot}/eslint.config.*",
38+
"!{projectRoot}/.eslintignore",
39+
"!{projectRoot}/mocha-setup.js",
40+
"!{projectRoot}/.mocharc",
41+
"!{projectRoot}/.mocharc.*",
42+
"!{projectRoot}/mocha.opts",
43+
"!{projectRoot}/.gitignore",
44+
"!{projectRoot}/.npmignore",
45+
"!{projectRoot}/.prettierignore",
46+
"!{projectRoot}/.prettierrc",
47+
"!{projectRoot}/.prettierrc.*",
48+
"!{projectRoot}/CHANGELOG.md",
49+
"!{projectRoot}/docs/**/*"
50+
],
51+
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yaml"]
52+
},
53+
"release": {
54+
"projects": [
55+
"packages/*"
56+
],
57+
"projectsRelationship": "independent",
58+
"changelog": {
59+
"projectChangelogs": true,
60+
"automaticFromRef": true
61+
},
62+
"version": {
63+
"conventionalCommits": true
64+
},
65+
"git": {
66+
"commit": true,
67+
"tag": true,
68+
"commitMessage": "chore(release): publish {version} [skip ci]"
69+
}
2070
}
2171
}

0 commit comments

Comments
 (0)