example(react-component): update example scripts. #584
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install | |
- run: npm run build | |
- run: npm install | |
- run: npm run build:create-tsbb | |
- run: npm run build:template | |
- run: npm run type-check | |
- name: example @example/babel-transform-ts | |
working-directory: examples/babel-transform-ts | |
run: npm run build | |
- name: example @example/basic | |
working-directory: examples/basic | |
run: npm run build && npm run coverage | |
- name: example @example/express | |
working-directory: examples/express | |
run: npm run build | |
- name: example @example/hapi | |
working-directory: examples/hapi | |
run: npm run build | |
- name: example @example/koa | |
working-directory: examples/koa | |
run: npm run build | |
- name: example @example/react-component | |
working-directory: examples/react-component | |
run: | | |
npm run build | |
npm run doc | |
npm run coverage | |
- name: example @example/react-component-tsx | |
working-directory: examples/react-component-tsx | |
run: | | |
npm run build | |
npm run doc | |
npm run coverage | |
cd lib/ | |
ls -al | |
- name: example @example/typenexus | |
working-directory: examples/typenexus | |
run: npm run build && npm run coverage | |
- name: example @example/umd | |
working-directory: examples/umd | |
run: npm run build && npm run coverage | |
- name: example @example/vue | |
working-directory: examples/vue | |
run: npm run build | |
- run: npm install idoc@1.25.0 -g | |
- run: idoc -s "TSBB {{version}}" | |
working-directory: packages/tsbb | |
- name: Generate Contributors Images | |
uses: jaywcjlove/github-action-contributors@main | |
with: | |
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\]) | |
output: ./packages/tsbb/dist/CONTRIBUTORS.svg | |
avatarSize: 36 | |
- name: Is a tag created auto? | |
id: create_tag | |
uses: jaywcjlove/create-tag-action@main | |
with: | |
package-path: ./packages/tsbb/package.json | |
- name: get tag version | |
id: tag_version | |
uses: jaywcjlove/changelog-generator@main | |
- name: Build and Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }} | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
force_orphan: true | |
publish_branch: gh-pages | |
publish_dir: ./packages/tsbb/dist/ | |
- name: Generate Changelog | |
id: changelog | |
uses: jaywcjlove/changelog-generator@main | |
if: steps.create_tag.outputs.successful | |
with: | |
head-ref: ${{ steps.create_tag.outputs.version }} | |
filter-author: (renovate-bot|Renovate Bot) | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
- name: Create Release | |
uses: jaywcjlove/create-tag-action@main | |
with: | |
package-path: ./packages/tsbb/package.json | |
release: true | |
body: | | |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/tsbb@${{steps.create_tag.outputs.versionNumber}}/file/README.md) | |
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/tsbb/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html | |
Comparing Changes: ${{ steps.changelog.outputs.compareurl }} | |
```bash | |
npm i tsbb@${{steps.create_tag.outputs.versionNumber}} | |
``` | |
${{ steps.changelog.outputs.changelog }} | |
- run: npm publish --access public | |
name: 📦 tsbb publish to NPM | |
continue-on-error: true | |
working-directory: packages/tsbb | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: copy example to create-tsbb | |
working-directory: packages/create-tsbb | |
run: npm run copy | |
- run: npm publish --access public | |
name: 📦 create-tsbb publish to NPM | |
continue-on-error: true | |
working-directory: packages/create-tsbb | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm publish --access public | |
name: 📦 @tsbb/typescript publish to NPM | |
continue-on-error: true | |
working-directory: packages/typescript | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm publish --access public | |
name: 📦 @tsbb/jest publish to NPM | |
continue-on-error: true | |
working-directory: packages/jest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm publish --access public | |
name: 📦 @tsbb/core publish to NPM | |
continue-on-error: true | |
working-directory: packages/core | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm publish --access public | |
name: 📦 @tsbb/babel publish to NPM | |
continue-on-error: true | |
working-directory: packages/babel | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |