chore(fix) mobile lower tab fix (#20) #8
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: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - src/** | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version bump' | |
| required: true | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - prerelease | |
| - prepatch | |
| - preminor | |
| - premajor | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: "release" | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: "Bump to new version" | |
| id: bump | |
| run: | | |
| _version=$(npm --no-git-tag-version version ${{ github.event.inputs.version || 'patch' }}) | |
| echo "new_version=$_version" >> $GITHUB_OUTPUT | |
| echo "New version: $_version" | |
| - name: "Create Pull Request" | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| title: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| body: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| commit-message: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| branch: "release-${{ env.NEW_VERSION }}" | |
| delete-branch: true | |
| env: | |
| NEW_VERSION: ${{ steps.bump.outputs.new_version }} | |
| - name: "Auto-merge PR" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" | |
| - name: "Wait for PR to merge" | |
| if: steps.cpr.outputs.pull-request-number != '' | |
| timeout-minutes: 3 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} | |
| run: | | |
| while true; do | |
| STATE=$(gh pr view "$PR_NUMBER" --json state --template '{{.state}}') | |
| if [ "$STATE" == "MERGED" ]; then | |
| echo "PR merged." | |
| break | |
| fi | |
| if [ "$STATE" == "CLOSED" ]; then | |
| echo "PR closed without merging." | |
| exit 1 | |
| fi | |
| echo "State: $STATE. Waiting 3s..." | |
| sleep 3 | |
| done | |
| - name: "Release" | |
| if: steps.cpr.outputs.pull-request-number != '' | |
| env: | |
| # https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} | |
| NEW_VERSION: ${{ steps.bump.outputs.new_version }} | |
| run: | | |
| gh release create $NEW_VERSION \ | |
| --target main \ | |
| -t $NEW_VERSION |