Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: switch from lerna to changesets for publishing new versions #1547

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
22 changes: 9 additions & 13 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,18 @@ jobs:
- name: build library
run: pnpm run build

- name: lerna version
- name: Publish to GitHub repository
Robbert marked this conversation as resolved.
Show resolved Hide resolved
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
id: changeset
env:
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: "NL Design System"
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: "NL Design System"
run: |
git push --set-upstream origin HEAD
pnpm run release

- name: lerna publish
env:
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_ACCESS_TOKEN}"
pnpm config set access public
pnpm run publish
pnpm config delete "//registry.npmjs.org/:_authToken"
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
commit: "docs(release): design system packages"
setupGitUser: false
title: "docs(release): design system packages"
publish: "pnpm run publish"
3 changes: 2 additions & 1 deletion .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"require-keywords": "off",
"require-license": "error",
"require-name": "error",
"require-repository": "off",
"require-repository": "error",
"require-repository-directory": "error",
"require-version": "error",
"scripts-type": "error",
"valid-values-author": "off",
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ package.json
pnpm-lock.yaml
yarn.lock
storybook-static

# Ignore changeset files, because they are temporary and frequently contributed by non-developers
.changeset/*.md
21 changes: 0 additions & 21 deletions lerna.json

This file was deleted.

16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
"bugs": "https://github.com/nl-design-system/denhaag/issues",
"repository": {
"type": "git",
"url": "https://github.com/nl-design-system/denhaag.git"
"url": "https://github.com/nl-design-system/denhaag.git",
"directory": "."
},
"license": "EUPL-1.2",
"author": "Municipality of The Hague",
"workspaces": [
"packages/*",
"components/*",
"proprietary/*"
],
"scripts": {
"build": "pnpm run build:library && pnpm run build:storybook",
"build:library": "pnpm run --recursive build",
Expand All @@ -33,9 +29,7 @@
"preinstall": "npx only-allow pnpm",
"prepublishOnly": "pinst --disable",
"prettier": "prettier --write .",
"publish": "lerna publish from-package --yes",
"release": "lerna version prerelease --no-changelog --no-private --no-commit-hooks --yes",
"release-denhaag-nl": "lerna version prerelease --no-changelog --no-private --no-commit-hooks --yes --no-git-tag-version --preid www-denhaag-nl",
"publish": "changeset publish",
"storybook": "npm-run-all --parallel watch:*",
"test-update": "npm-run-all --sequential lint build",
"update-patch": "npm-check-updates --configFileName .ncurc.patch.js",
Expand All @@ -56,11 +50,9 @@
"@babel/core": "7.24.6",
"@babel/preset-env": "7.24.6",
"@babel/preset-react": "7.24.6",
"@changesets/cli": "2.27.7",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@lerna-lite/cli": "3.4.0",
"@lerna-lite/publish": "3.4.0",
"@lerna-lite/version": "3.4.0",
"@rollup/plugin-commonjs": "25.0.8",
"@rollup/plugin-node-resolve": "15.2.3",
"@svgr/rollup": "8.1.0",
Expand Down
Loading