Skip to content

Commit

Permalink
Installing and configuring Auto (#476)
Browse files Browse the repository at this point in the history
* Installing and configuring Auto

Installing Auto (https://intuit.github.io/auto/index) for automated
publishing. Since this repo has a number of labels already, I disabled
the default labels and added custom entries to match the labels that
were created.

I created a basic workflow for releasing that doesn't have anything
lerna specific (although `lerna` is used internally with `auto`) but run
the `release` npm script (which is `auto shipit --dry-run -v` for now).

Testing locally I ran into an issue where an lerna error will be thrown.
This issue seems to be known (see
intuit/auto#2129) with a workaround by adding
a "registry" entry to lerna.json (although seems to continue to fail
with --dry-run option).

* Removing dry-run from shipit

After testing the lerna comands locally, I'm removing `--dry-run` to
test publishing canary versions in a pull-request.

* adding `very verbose` logging to diagnose lerna command timeout

* Consistent use of `prepare` and `npm-run-all`

Using `prepare` npm lifecycle script for all packages (as opposed to
prepublishOnly) and consistently using `npm-run-all` for any package
that has multiple scripts to run during `prepare`.

* upgrading gh actions and adding more npm logging

* dropping npm-run-all

* Turning down the logging level
  • Loading branch information
Nathan Stilwell authored Oct 17, 2022
1 parent ed7256c commit 603b1f0
Show file tree
Hide file tree
Showing 7 changed files with 792 additions and 64 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Based on https://intuit.github.io/auto/docs/build-platforms/github-actions
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release
env: #Tokens generated under github account: https://github.com/nathanstilwell
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --frozen-lockfile
yarn run release
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
],
"version": "independent",
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useNx": false
"useNx": false,
"registry": "https://registry.npmjs.org"
}
43 changes: 40 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,51 @@
"name": "root",
"private": true,
"devDependencies": {
"lerna": "5.6.2"
"auto": "^10.37.6",
"lerna": "^5.6.2"
},
"scripts": {
"init": "yarn install && yarn lerna run build",
"start": "lerna run start --parallel"
"start": "lerna run start --parallel",
"release": "auto shipit -v"
},
"resolutions": {},
"workspaces": [
"packages/*"
]
],
"repository": "cockroachdb/ui",
"author": "Cockroach Labs <[email protected]>",
"auto": {
"plugins": [
"npm"
],
"noDefaultLabels": true,
"labels": [
{
"releaseType": "major",
"name": "🤖 major"
},
{
"releaseType": "minor",
"name": "🤖 minor"
},
{
"releaseType": "patch",
"name": "🤖 patch"
},
{
"releaseType": "major",
"name": "🤖 major"
},
{
"releaseType": "skip",
"name": "🤖 skip-release"
},
{
"releaseType": "none",
"name": ":memo: docs",
"changelogTitle": "📝 Documentation"
}
]
}
}
2 changes: 1 addition & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"build": "style-dictionary build",
"clean": "style-dictionary clean",
"prepublishOnly": "npm run clean && npm run build",
"prepare": "npm run clean && npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"license": "MIT",
Expand Down
7 changes: 3 additions & 4 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "npm-run-all build:generate:* build:typescript",
"build": "npm run build:generate:stripfill && npm run build:generate:preserve && npm run build:typescript",
"build:typescript": "tsc",
"build:generate:stripfill": "svgr --typescript --icon -d src/components svg/customFill",
"build:generate:preserve": "svgr --typescript --icon --no-runtime-config -d src/components svg/preserveFill",
"build:watch": "tsc --watch",
"clean": "rimraf dist src/components",
"prepare": "npm-run-all clean build",
"prepare": "npm run clean && npm run build",
"test": "node notests.js",
"start": "npm-run-all build:watch"
"start": "npm run build:watch"
},
"license": "MIT",
"devDependencies": {
"@svgr/cli": "5.3.0",
"@types/react": "17.0.50",
"chalk": "5.1.0",
"node-emoji": "1.11.0",
"npm-run-all": "4.1.5",
"react": "17.0.2",
"rimraf": "3.0.2",
"typescript": "4.8.4"
Expand Down
5 changes: 2 additions & 3 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"main": "dist/main.js",
"types": "dist/types/index.d.ts",
"scripts": {
"build": "npm-run-all build:typescript build:bundle",
"build": "npm run build:typescript && npm run build:bundle",
"build:bundle": "webpack",
"build:typescript": "tsc",
"build:watch": "webpack --watch",
"ci": "jest --ci -i",
"clean": "rm -rf ./dist/*",
"lint": "eslint \"src/**/*.{tsx,ts,js}\"",
"lint:fix": "eslint \"src/**/*.{tsx,ts,js}\" --fix",
"prepublishOnly": "npm-run-all clean build",
"prepare": "npm run clean && npm run build",
"test": "jest --watch",
"test:version": "npm version prerelease --preid='alpha'",
"test:publish": "npm publish --tag testing",
Expand All @@ -30,7 +30,6 @@
"@cockroachlabs/icons": "^0.5.3",
"@popperjs/core": "^2.9.2",
"@types/recharts": "^1.8.23",
"npm-run-all": "^4.1.5",
"react-lines-ellipsis": "^0.15.0",
"react-popper": "^2.2.5",
"recharts": "^2.1.12"
Expand Down
Loading

0 comments on commit 603b1f0

Please sign in to comment.