release #139
This file contains hidden or 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: release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| if: github.ref_name == 'v1.x' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup-node | |
| - name: Build | |
| run: npm run build | |
| - name: Code lint | |
| run: npm run lint | |
| - name: Unit test | |
| run: npm run test | |
| - name: Git config | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Version bump | |
| run: npx lerna version --yes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Rebuild | |
| run: npm run build #将新版本号注入到构建中 | |
| - name: Publish | |
| uses: FrontEndDev-org/publish-node-package-action@v5 | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} |