|
| 1 | +name: Build & Deploy |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-deploy: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v3 |
| 12 | + - uses: actions/setup-node@v3 |
| 13 | + with: |
| 14 | + node-version: 16 |
| 15 | + registry-url: 'https://registry.npmjs.org' |
| 16 | + |
| 17 | + - run: npm install |
| 18 | + - run: npm run build |
| 19 | + - run: npm install |
| 20 | + - run: npm run build:create-tsbb |
| 21 | + - run: npm run build:template |
| 22 | + - run: npm run type-check |
| 23 | + |
| 24 | + - name: copy create-tsbb examples |
| 25 | + working-directory: packages/create-tsbb |
| 26 | + run: npm run copy |
| 27 | + |
| 28 | + - name: example @example/babel-transform-ts |
| 29 | + working-directory: examples/babel-transform-ts |
| 30 | + run: npm run build |
| 31 | + |
| 32 | + - name: example @example/basic |
| 33 | + working-directory: examples/basic |
| 34 | + run: npm run build && npm run coverage |
| 35 | + |
| 36 | + - name: example @example/express |
| 37 | + working-directory: examples/express |
| 38 | + run: npm run build |
| 39 | + |
| 40 | + - name: example @example/hapi |
| 41 | + working-directory: examples/hapi |
| 42 | + run: npm run build |
| 43 | + |
| 44 | + - name: example @example/koa |
| 45 | + working-directory: examples/koa |
| 46 | + run: npm run build |
| 47 | + |
| 48 | + - name: example @example/react-component |
| 49 | + working-directory: examples/react-component |
| 50 | + env: |
| 51 | + CI: true |
| 52 | + run: | |
| 53 | + npm run build |
| 54 | + npm run doc |
| 55 | + npm run coverage |
| 56 | +
|
| 57 | + - name: example @example/react-component-tsx |
| 58 | + working-directory: examples/react-component-tsx |
| 59 | + env: |
| 60 | + CI: true |
| 61 | + run: | |
| 62 | + npm run build |
| 63 | + npm run doc |
| 64 | + npm run coverage |
| 65 | + cd lib/ |
| 66 | + ls -al |
| 67 | +
|
| 68 | + - name: example @example/typenexus |
| 69 | + working-directory: examples/typenexus |
| 70 | + run: npm run build && npm run coverage |
| 71 | + |
| 72 | + - name: example @example/umd |
| 73 | + working-directory: examples/umd |
| 74 | + run: npm run build && npm run coverage |
| 75 | + |
| 76 | + - name: example @example/vue |
| 77 | + working-directory: examples/vue |
| 78 | + run: npm run build |
| 79 | + |
| 80 | + - run: npm install idoc@1.25.0 -g |
| 81 | + - run: idoc -s "TSBB {{version}}" |
| 82 | + working-directory: packages/tsbb |
| 83 | + |
| 84 | + - name: Generate Contributors Images |
| 85 | + uses: jaywcjlove/github-action-contributors@main |
| 86 | + with: |
| 87 | + filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\]) |
| 88 | + output: ./packages/tsbb/dist/CONTRIBUTORS.svg |
| 89 | + avatarSize: 36 |
| 90 | + |
| 91 | + - name: Is a tag created auto? |
| 92 | + id: create_tag |
| 93 | + uses: jaywcjlove/create-tag-action@main |
| 94 | + with: |
| 95 | + package-path: ./packages/tsbb/package.json |
| 96 | + |
| 97 | + - name: get tag version |
| 98 | + id: tag_version |
| 99 | + uses: jaywcjlove/changelog-generator@main |
| 100 | + |
| 101 | + - name: Build and Deploy |
| 102 | + uses: peaceiris/actions-gh-pages@v3 |
| 103 | + with: |
| 104 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }} |
| 106 | + user_name: 'github-actions[bot]' |
| 107 | + user_email: 'github-actions[bot]@users.noreply.github.com' |
| 108 | + force_orphan: true |
| 109 | + publish_branch: gh-pages |
| 110 | + publish_dir: ./packages/tsbb/dist/ |
| 111 | + |
| 112 | + - name: Generate Changelog |
| 113 | + id: changelog |
| 114 | + uses: jaywcjlove/changelog-generator@main |
| 115 | + if: steps.create_tag.outputs.successful |
| 116 | + with: |
| 117 | + head-ref: ${{ steps.create_tag.outputs.version }} |
| 118 | + filter-author: (renovate-bot|Renovate Bot) |
| 119 | + filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' |
| 120 | + |
| 121 | + - name: Create Release |
| 122 | + uses: jaywcjlove/create-tag-action@main |
| 123 | + with: |
| 124 | + package-path: ./packages/tsbb/package.json |
| 125 | + release: true |
| 126 | + body: | |
| 127 | + [](https://uiwjs.github.io/npm-unpkg/#/pkg/tsbb@${{steps.create_tag.outputs.versionNumber}}/file/README.md) |
| 128 | +
|
| 129 | + Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/tsbb/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html |
| 130 | + Comparing Changes: ${{ steps.changelog.outputs.compareurl }} |
| 131 | +
|
| 132 | + ```bash |
| 133 | + npm i tsbb@${{steps.create_tag.outputs.versionNumber}} |
| 134 | + ``` |
| 135 | +
|
| 136 | + ${{ steps.changelog.outputs.changelog }} |
| 137 | +
|
| 138 | + - run: npm publish --access public |
| 139 | + name: 📦 tsbb publish to NPM |
| 140 | + continue-on-error: true |
| 141 | + working-directory: packages/tsbb |
| 142 | + env: |
| 143 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 144 | + |
| 145 | + - name: copy example to create-tsbb |
| 146 | + working-directory: packages/create-tsbb |
| 147 | + run: npm run copy |
| 148 | + |
| 149 | + - run: npm publish --access public |
| 150 | + name: 📦 create-tsbb publish to NPM |
| 151 | + continue-on-error: true |
| 152 | + working-directory: packages/create-tsbb |
| 153 | + env: |
| 154 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 155 | + |
| 156 | + - run: npm publish --access public |
| 157 | + name: 📦 @tsbb/typescript publish to NPM |
| 158 | + continue-on-error: true |
| 159 | + working-directory: packages/typescript |
| 160 | + env: |
| 161 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 162 | + |
| 163 | + - run: npm publish --access public |
| 164 | + name: 📦 @tsbb/jest publish to NPM |
| 165 | + continue-on-error: true |
| 166 | + working-directory: packages/jest |
| 167 | + env: |
| 168 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 169 | + |
| 170 | + - run: npm publish --access public |
| 171 | + name: 📦 @tsbb/core publish to NPM |
| 172 | + continue-on-error: true |
| 173 | + working-directory: packages/core |
| 174 | + env: |
| 175 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 176 | + |
| 177 | + - run: npm publish --access public |
| 178 | + name: 📦 @tsbb/babel publish to NPM |
| 179 | + continue-on-error: true |
| 180 | + working-directory: packages/babel |
| 181 | + env: |
| 182 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments