Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .github/actions/install-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,13 @@ runs:
- name: Install Dependencies (Linux)
if: inputs.os != 'windows-latest'
shell: bash
run: npm ci && npm run bootstrap
run: npm ci
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer need lerna bootstrap step


- name: Install Dependencies (Windows)
if: inputs.os == 'windows-latest'
shell: pwsh
run: |
npm ci
if ($LASTEXITCODE -eq 0) {
npm run bootstrap
} else {
exit $LASTEXITCODE
}

- name: Disable Nx daemon
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is all lerna nonsense and that's why it's being removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it was some suggestions around some of the lerna + nx stuff to help with the windows builds

if: inputs.os == 'windows-latest'
shell: pwsh
run: |
"NX_DAEMON=false" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Nx reset
if: inputs.os == 'windows-latest'
shell: pwsh
run: npx nx reset

- name: Build (Linux)
if: inputs.os != 'windows-latest'
Expand Down
45 changes: 17 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,62 +72,51 @@ jobs:
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci && npm run bootstrap
run: npm ci

- name: Build
run: npm run build

- name: Version (main branch)
- name: Prepare release (main branch)
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
run: npm run version
run: npm run prepare-release
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}

- name: Publish (main branch)
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
run: npm run publish-packages
- name: Prepare release (canary branch)
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
run: npm run prepare-release:canary
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}

- name: Version (canary branch)
- name: Push release commit + tags (canary)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order to support canary releases on a dist-tag other than latest in npm we need to separate some of the nx life cycle commands so that we can call nx release publish --tag=canary. But this means that after we run the version + changelog + skip-publish via nx release that we have tags and a commit that has not been pushed.

This step pushes those commits

if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
run: npm run version:canary
run: |
git push --follow-tags --no-verify --atomic
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}

- name: Publish (main branch)
if: (github.event.workflow_run.head_branch || github.ref_name) == 'main'
run: npm run publish-packages
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
NPM_CONFIG_PROVENANCE: true

- name: Publish (canary branch)
if: (github.event.workflow_run.head_branch || github.ref_name) == 'canary'
run: npm run publish-packages:canary
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}
GIT_AUTHOR_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_AUTHOR_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
NPM_CONFIG_PROVENANCE: true

- name: Print lerna debug log
if: always()
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
@contentful:registry=https://registry.npmjs.org
ignore-scripts=true
50 changes: 50 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
Expand All @@ -17,5 +18,54 @@
"^build"
]
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/test/**/*",
"!{projectRoot}/**/*.spec.ts",
"!{projectRoot}/**/*.spec.tsx",
"!{projectRoot}/**/*.spec.js",
"!{projectRoot}/**/*.test.ts",
"!{projectRoot}/**/*.test.tsx",
"!{projectRoot}/**/*.test.js",
"!{projectRoot}/jest.config.js",
"!{projectRoot}/jest.config.ts",
"!{projectRoot}/.eslintrc",
"!{projectRoot}/.eslintrc.*",
"!{projectRoot}/eslint.config.*",
"!{projectRoot}/.eslintignore",
"!{projectRoot}/mocha-setup.js",
"!{projectRoot}/.mocharc",
"!{projectRoot}/.mocharc.*",
"!{projectRoot}/mocha.opts",
"!{projectRoot}/.gitignore",
"!{projectRoot}/.npmignore",
"!{projectRoot}/.prettierignore",
"!{projectRoot}/.prettierrc",
"!{projectRoot}/.prettierrc.*",
"!{projectRoot}/CHANGELOG.md",
"!{projectRoot}/docs/**/*"
],
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yaml"]
},
"release": {
"projects": [
"packages/*"
],
"projectsRelationship": "independent",
"changelog": {
"projectChangelogs": true,
"automaticFromRef": true
},
"version": {
"conventionalCommits": true
},
"git": {
"commit": true,
"tag": true,
"commitMessage": "chore(release): publish {version} [skip ci]"
}
}
}
Loading