|
| 1 | +name: (manual PR) Bump release version |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + name: |
| 6 | + version: |
| 7 | + type: string |
| 8 | + description: Release name |
| 9 | + required: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + publish: |
| 13 | + continue-on-error: true |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: 🏗 Setup repo |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + uses: ./.github/actions/install |
| 22 | + |
| 23 | + - name: Set env |
| 24 | + run: | |
| 25 | + BRANCH_NAME="bump-docs-$(date "+%Y%m%d%H%M%S")" |
| 26 | + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV |
| 27 | +
|
| 28 | + - name: Bump docs version |
| 29 | + working-directory: website |
| 30 | + run: | |
| 31 | + yarn version ${{github.event.inputs.name}} |
| 32 | +
|
| 33 | + - name: Bump base version |
| 34 | + working-directory: packages/base |
| 35 | + run: | |
| 36 | + npm version v${{github.event.inputs.name}} |
| 37 | + - name: Bump themed version |
| 38 | + working-directory: packages/themed |
| 39 | + run: | |
| 40 | + npm version v${{github.event.inputs.name}} |
| 41 | +
|
| 42 | + - name: Config git |
| 43 | + run: | |
| 44 | + git config --local user.email "[email protected]" |
| 45 | + git config --local user.name "RNEUI" |
| 46 | +
|
| 47 | + - name: Checkout |
| 48 | + run: | |
| 49 | + git add . |
| 50 | + git commit -m "Bump v${{github.event.inputs.pr}}" |
| 51 | + git checkout -b ${{ env.BRANCH_NAME }} |
| 52 | + git push --set-upstream origin ${{ env.BRANCH_NAME }} --force |
| 53 | +
|
| 54 | + - name: Create Pull Request |
| 55 | + continue-on-error: true |
| 56 | + uses: actions/github-script@v6 |
| 57 | + with: |
| 58 | + script: | |
| 59 | + const { repo, owner } = context.repo; |
| 60 | + const result = await github.rest.pulls.create({ |
| 61 | + title: 'chore: bump v${{github.event.inputs.pr}}', |
| 62 | + owner, |
| 63 | + repo, |
| 64 | + head: '${{ env.BRANCH_NAME }}', |
| 65 | + base: 'next', |
| 66 | + body: [ |
| 67 | + 'This PR is auto-generated by', |
| 68 | + '[actions/github-script](https://github.com/actions/github-script).' |
| 69 | + ].join('\n') |
| 70 | + }); |
| 71 | + github.rest.issues.addLabels({ |
| 72 | + owner, |
| 73 | + repo, |
| 74 | + issue_number: result.data.number, |
| 75 | + labels: ['feature', 'automated pr', 'need-review'] |
| 76 | + }); |
0 commit comments