Cut version #64
This file contains 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: Cut version | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
type: choice | |
description: The intended type of release (patch requires manual handling) | |
options: | |
- minor | |
- major | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer | |
jobs: | |
cut-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
- name: Ensure unique tag | |
run: if [[ $(git tag -l $(Scripts/version show-current)) ]]; then exit 1; fi | |
- name: Create and push tag | |
run: | | |
git tag $(Scripts/version show-current) | |
git push --tags | |
- name: Git Config | |
run: | | |
git config --local user.name "CI" | |
git config --local user.email "[email protected]" | |
- name: Bump version | |
env: | |
GH_TOKEN: ${{ secrets.CI_TOKEN }} | |
run: | | |
Scripts/version increment ${{ github.event.inputs.release_type }} | |
branch_name="version-increment/$(Scripts/version show-current)" | |
git checkout -b "$branch_name" | |
git add 'Sources/StytchCore/ClientInfo/ClientInfo+Version.swift' | |
git commit -m "[version] Increment to $(Scripts/version show-current)" --author "CI <[email protected]>" | |
git push --set-upstream origin "$branch_name" | |
gh pr create --body 'As titled' --fill | |
gh pr merge --auto --squash | |
- name: Approve version PR | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr review --approve |