|
| 1 | +# WARNING: DO NOT EDIT! |
| 2 | +# |
| 3 | +# This file was generated by plugin_template, and is managed by it. Please use |
| 4 | +# './plugin-template --github pulp_python' to update this file. |
| 5 | +# |
| 6 | +# For more info visit https://github.com/pulp/plugin_template |
| 7 | +--- |
| 8 | +name: Create New Release Branch |
| 9 | +on: |
| 10 | + workflow_dispatch: |
| 11 | + inputs: |
| 12 | + name: |
| 13 | + description: "Branch name (e.g. 3.14)" |
| 14 | + required: true |
| 15 | + |
| 16 | +env: |
| 17 | + RELEASE_WORKFLOW: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + create-branch: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + with: |
| 29 | + # by default, it uses a depth of 1 |
| 30 | + # this fetches all history so that we can read each commit |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: "3.8" |
| 36 | + |
| 37 | + - name: Install python dependencies |
| 38 | + run: | |
| 39 | + echo ::group::PYDEPS |
| 40 | + pip install bump2version |
| 41 | + echo ::endgroup:: |
| 42 | +
|
| 43 | + - name: Setting secrets |
| 44 | + run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" |
| 45 | + env: |
| 46 | + SECRETS_CONTEXT: ${{ toJson(secrets) }} |
| 47 | + |
| 48 | + - name: Verify that branch name matches current version string on master branch |
| 49 | + run: | |
| 50 | + X_Y_VERSION=$(grep version setup.py | sed -rn 's/version="(.*)\.0\.dev",/\1/p' | awk '{$1=$1};1') |
| 51 | + if [[ "$X_Y_VERSION" != "${{ github.event.inputs.name }}" ]] |
| 52 | + then |
| 53 | + echo "Branch name doesn't match the current version string $X_Y_VERSION." |
| 54 | + exit 1 |
| 55 | + fi |
| 56 | +
|
| 57 | + - name: Create ${{ github.event.inputs.name }} release branch |
| 58 | + run: | |
| 59 | + git checkout -b ${{ github.event.inputs.name }} |
| 60 | + git push origin ${{ github.event.inputs.name }} |
| 61 | +
|
| 62 | + - name: Bump version on master branch |
| 63 | + run: | |
| 64 | + git checkout master |
| 65 | + bump2version --no-commit minor |
| 66 | +
|
| 67 | + - name: Make a PR with version bump |
| 68 | + uses: peter-evans/create-pull-request@v3 |
| 69 | + with: |
| 70 | + committer: pulpbot <pulp-infra@redhat.com> |
| 71 | + author: pulpbot <pulp-infra@redhat.com> |
| 72 | + branch: minor-version-bump |
| 73 | + base: master |
| 74 | + title: Bump minor version |
| 75 | + body: '[noissue]' |
| 76 | + commit-message: | |
| 77 | + Bump minor version |
| 78 | + [noissue] |
| 79 | + delete-branch: true |
0 commit comments