|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | versionName: |
7 | | - description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)' |
| 7 | + description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major)' |
8 | 8 | required: true |
9 | 9 | default: patch |
10 | 10 |
|
|
28 | 28 | - name: Change version number |
29 | 29 | id: version |
30 | 30 | run: | |
31 | | - python -m pip install bump2version |
32 | | - echo -n "::set-output name=next_tag::" |
33 | | - bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",, |
| 31 | + python -m pip install bump-my-version |
| 32 | + echo -n "next_tag=" >> $GITHUB_OUTPUT |
| 33 | + allowed_pattern="^(major|minor|patch|[0-9]+\.[0-9]+\.[0-9]+)$" |
| 34 | +
|
| 35 | + if [[ ! ${{ github.event.inputs.versionName }} =~ $allowed_pattern ]]; then |
| 36 | + echo "Invalid version name:${{ github.event.inputs.versionName }}" |
| 37 | + exit 1 |
| 38 | + fi |
| 39 | +
|
| 40 | + if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then |
| 41 | + echo "next_tag=${{ github.event.inputs.versionName }}" >> $GITHUB_OUTPUT |
| 42 | + else |
| 43 | + echo "next_tag=$(bump-my-version show-bump | grep${{ github.event.inputs.versionName }} | sed -r s,"^.*─ ",,)" >> $GITHUB_OUTPUT |
| 44 | + fi |
34 | 45 | - name: Get main branch SHA |
35 | 46 | id: base-sha |
36 | 47 | run: echo "sha=$(git rev-parse origin/main)" >> $GITHUB_OUTPUT |
|
46 | 57 | if: steps.changed-py.outputs.any_changed == 'true' |
47 | 58 | run: | |
48 | 59 | cd src/client/packaging/pypi |
49 | | - bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} ignore_part |
| 60 | + bump-my-version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} |
50 | 61 | - name: Create pull request into prod |
51 | 62 | uses: peter-evans/create-pull-request@v3 |
52 | 63 | with: |
|
0 commit comments