Skip to content

Commit

Permalink
ci(cd): build types and docs on release (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Jan 16, 2024
1 parent cafd051 commit e569909
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/cd.yml
Expand Up @@ -29,6 +29,26 @@ jobs:
release-type: node
package-name: node-unrtf

- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Build types and documentation
run: |
npm i --ignore-scripts
npm run build
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git commit -am "chore: update types and documentation"
git push
publish-npm:
name: Publish to NPM
needs: release
Expand All @@ -55,8 +75,6 @@ jobs:
# Build docs and TS definitions and remove dev values
# from package.json before publishing to reduce package size
run: |
npm i --ignore-scripts
npm run build
npm pkg delete commitlint devDependencies jest scripts
npm publish --ignore-scripts --provenance
Expand Down Expand Up @@ -92,7 +110,5 @@ jobs:
# Build docs and TS definitions and remove dev values
# from package.json before publishing to reduce package size
run: |
npm i --ignore-scripts
npm run build
npm pkg delete commitlint devDependencies jest scripts
npm publish --ignore-scripts --provenance
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -35,7 +35,7 @@
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc && jsdoc2md src/index.js > API.md && npm run lint:prettier:fix",
"build": "tsc && jsdoc2md src/index.js > API.md && prettier API.md types/index.d.ts -w -u",
"jest": "jest",
"jest:coverage": "jest --coverage",
"lint": "eslint . --cache --ext js,jsx --ignore-path .gitignore",
Expand Down

0 comments on commit e569909

Please sign in to comment.