-
Notifications
You must be signed in to change notification settings - Fork 184
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
fix(release): separate docs search index generation #1884
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,11 @@ on: | |
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
if: github.actor != 'carbon-bot' && !startsWith(github.event.head_commit.message, 'skip-release') | ||
name: Create release - Node.js v20.17.0 | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -16,44 +17,38 @@ jobs: | |
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Use Node.js 20.17.0 | ||
- name: Set git user to carbon-bot | ||
run: | | ||
git config --global user.email "carbon@us.ibm.com" | ||
git config --global user.name "carbon-bot" | ||
|
||
- name: Use Node.js 20.x LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.17.0' | ||
node-version: '20.x' | ||
cache: 'yarn' | ||
registry-url: 'https://registry.npmjs.org/' | ||
always-auth: true | ||
auth-token: ${{ secrets.NPM_TOKEN }} | ||
Comment on lines
+28
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eliminate need for explicit minor versions, set yarn cache and npmjs authentication here instead of below. |
||
|
||
- name: Install dependencies 🔧 | ||
run: yarn install --immutable --check-cache | ||
|
||
- name: Set git user and get git into the right state | ||
run: | | ||
git config --global user.email "carbon@us.ibm.com" | ||
git config --global user.name "carbon-bot" | ||
git checkout master | ||
- name: Generate search index for docs website | ||
run: lerna run build:search --scope @carbon/charts-docs # should be committed in next step | ||
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separated this from docs package build. |
||
|
||
- name: Create version and change logs | ||
- name: Create version and change logs and commit to master | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this commits the new version numbers to master, it can also commit the rebuilt search index for the docs website. |
||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: npx lerna version --yes --force-publish --conventional-commits --create-release github | ||
|
||
- name: Rebuild packages and documentation 🔧 | ||
- name: Build latest version's packages (including angular/dist) 🔧 | ||
run: | | ||
yarn build | ||
node scripts/update-angular-dependency-version.mjs | ||
|
||
- name: Commit and push changes (if there are any) | ||
run: | | ||
git add . | ||
if ! git diff-index --quiet HEAD; then | ||
git commit -m "skip-release - chore(build): updated search index for docs" | ||
git push origin master | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Publish to npmjs registry and Github | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} -q | ||
npx lerna publish from-git --yes --force-publish | ||
Comment on lines
-43
to
-56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already handled above. |
||
run: npx lerna publish from-git --yes --force-publish | ||
|
||
- name: Deploy documentation to Github Pages 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
"build:search": "node generateSearchIndex.mjs", | ||
"build:netlify-dp": "vite build --emptyOutDir --outDir dist && typedoc --tsconfig ../core/tsconfig.json ../core/src/index.ts --out dist/api", | ||
"files:pages": "touch ../../pages/.nojekyll && echo 'charts.carbondesignsystem.com' > ../../pages/CNAME", | ||
"build": "yarn build:search && yarn build:docs && yarn files:pages && yarn build:api:docs", | ||
"dev": "vite --port 3000", | ||
"build": "yarn build:docs && yarn files:pages && yarn build:api:docs", | ||
"dev": "yarn build:search && vite --port 3000", | ||
Comment on lines
-16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed building of search index from docs package build. Ensure index is rebuilt before previewing site. |
||
"lint": "eslint", | ||
"format": "prettier . --write --ignore-path ../../.prettierignore" | ||
}, | ||
|
@@ -36,13 +36,13 @@ | |
"@types/react-dom": "^18.3.0", | ||
"@types/topojson-specification": "^1.0.5", | ||
"@vitejs/plugin-react-swc": "^3.7.0", | ||
"eslint": "^9.9.1", | ||
"eslint": "^9.10.0", | ||
"jsdom": "^25.0.0", | ||
"prettier": "^3.3.3", | ||
"sass": "^1.77.8", | ||
"sass": "^1.78.0", | ||
"typedoc": "^0.26.6", | ||
"typescript": "^5.5.4", | ||
"vite": "^5.4.2" | ||
"vite": "^5.4.3" | ||
}, | ||
"publishConfig": { | ||
"access": "restricted" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved these up closer to the checkout.