perf(issue): 优化问题和推送信息渲染逻辑 #56
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: 发布发行版 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| packages: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release-please.outputs.releases_created }} | |
| steps: | |
| - name: 获取token | |
| uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: 获取用户ID | |
| id: get-user-id | |
| run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: 运行 release-please-action | |
| id: release-please | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| config-file: .release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| build: | |
| needs: [release] | |
| if: needs.release.outputs.releases_created == 'true' | |
| uses: ./.github/workflows/build.yaml | |
| publish-to-github: | |
| runs-on: ubuntu-latest | |
| needs: [release, build] | |
| if: needs.release.outputs.releases_created == 'true' | |
| steps: | |
| - name: 导入构建产物 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: plugin | |
| path: ./ | |
| - name: 发布到 GitHub Packages | |
| id: publish-to-github | |
| uses: JS-DevTools/npm-publish@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| registry: https://npm.pkg.github.com | |
| access: public | |
| provenance: true | |
| publish-to-npm: | |
| runs-on: ubuntu-latest | |
| needs: [release, build] | |
| if: needs.release.outputs.releases_created == 'true' | |
| steps: | |
| - name: 导入构建产物 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: plugin | |
| path: ./ | |
| - name: 发布到 NPM | |
| id: publish-to-npm | |
| uses: JS-DevTools/npm-publish@v3 | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| registry: https://registry.npmjs.org/ | |
| access: public | |
| provenance: true |