Bump Version #25
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: Bump Version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump_type: | |
| description: 'Version bump type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| bump: | |
| name: Bump Version | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run version bump script | |
| id: bump | |
| run: | | |
| chmod +x scripts/bump-version.sh | |
| OUTPUT=$(./scripts/bump-version.sh ${{ inputs.bump_type }}) | |
| echo "$OUTPUT" | |
| NEW_VERSION=$(echo "$OUTPUT" | grep "^Version:" | sed 's/.*-> //') | |
| NEW_BUILD=$(echo "$OUTPUT" | grep "^Build:" | sed 's/.*-> //') | |
| echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
| echo "new_build=$NEW_BUILD" >> "$GITHUB_OUTPUT" | |
| - name: Create branch and PR | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| BRANCH="bump/${{ steps.bump.outputs.new_version }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$BRANCH" | |
| git add RemoteShutter.xcodeproj/project.pbxproj | |
| git commit -m "Bump version to ${{ steps.bump.outputs.new_version }} (build ${{ steps.bump.outputs.new_build }})" | |
| git push origin "$BRANCH" | |
| gh pr create \ | |
| --title "Bump version to ${{ steps.bump.outputs.new_version }}" \ | |
| --body "Automated ${{ inputs.bump_type }} version bump: **${{ steps.bump.outputs.new_version }}** (build ${{ steps.bump.outputs.new_build }})" \ | |
| --base master \ | |
| --head "$BRANCH" |