chore(ci): fix auto publish #2
Workflow file for this run
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: auto-publish | ||
| on: | ||
| release: | ||
| types: [created] | ||
| jobs: | ||
| publish-official-website: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: main | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| token: ${{ secrets.TDESIGN_BOT_TOKEN }} | ||
| - name: update official website | ||
| run: | | ||
| git config --local user.email "tdesign@tencent.com" | ||
| git config --local user.name "tdesign-bot" | ||
| git status | ||
| git fetch origin | ||
| git merge origin/develop | ||
| git push origin main | ||
| publish-miniprogram: | ||
| if: startsWith(github.event.release.tag_name,'tdesign-miniprogram') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| - uses: pnpm/action-setup@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 18 | ||
| - run: pnpm install | ||
| - run: pnpm build | ||
| - uses: actions/github-script@v7 | ||
| id: version | ||
| script: | | ||
| const tagName = '${{ github.event.release.tag_name }}' | ||
| const lastIndex = tagName.lastIndexOf('@'); | ||
| const version = tagName.slice(lastIndex + 1); | ||
| core.setOutput('version', version); | ||
| - name: release miniprogram | ||
| uses: LeeJim/setup-miniprogram@main | ||
| with: | ||
| project_type: miniProgram | ||
| action_type: upload | ||
| project_path: ./_example | ||
| version: ${{ steps.version.outputs.version }} | ||
| es6: true | ||
| es7: true | ||
| minify: true | ||
| env: | ||
| MINI_APP_ID: ${{ secrets.TDESIGN_APP_ID }} | ||
| MINI_APP_PRIVATE_KEY: ${{ secrets.TDESIGN_MINI_KEY }} | ||