|
| 1 | +name: Create Release PR |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Release version (e.g., v5.8.0)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + |
| 11 | +jobs: |
| 12 | + create-release-pr: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + pull-requests: write |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Validate and extract version |
| 20 | + id: version |
| 21 | + run: | |
| 22 | + VERSION="${{ github.event.inputs.version }}" |
| 23 | + if [[ ! "$VERSION" =~ ^v[0-9]+(\.[0-9]+){2,}$ ]]; then |
| 24 | + echo "Error: Version must start with 'v' followed by numbers and dots (e.g., v5.8.0)" |
| 25 | + echo "Provided version: $VERSION" |
| 26 | + exit 1 |
| 27 | + fi |
| 28 | + echo "Version format is valid: $VERSION" |
| 29 | + # Remove 'v' prefix for file updates |
| 30 | + VERSION_NUMBER="${VERSION#v}" |
| 31 | + echo "version_number=$VERSION_NUMBER" >> $GITHUB_OUTPUT |
| 32 | + echo "version_tag=$VERSION" >> $GITHUB_OUTPUT |
| 33 | +
|
| 34 | + - name: Checkout repository |
| 35 | + uses: actions/checkout@v5 |
| 36 | + |
| 37 | + - name: Update version files |
| 38 | + run: | |
| 39 | + chmod +x .github/scripts/update-version.sh |
| 40 | + ./.github/scripts/update-version.sh "${{ steps.version.outputs.version_number }}" |
| 41 | +
|
| 42 | + - name: Create Pull Request |
| 43 | + uses: peter-evans/create-pull-request@v8 |
| 44 | + with: |
| 45 | + branch: release/${{ steps.version.outputs.version_tag }} |
| 46 | + delete-branch: true |
| 47 | + title: "Bump release to ${{ steps.version.outputs.version_number }}" |
| 48 | + commit-message: | |
| 49 | + Bump release to ${{ steps.version.outputs.version_number }} |
| 50 | +
|
| 51 | + Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
| 52 | + body: | |
| 53 | + ## Release ${{ steps.version.outputs.version_tag }} |
| 54 | +
|
| 55 | + This PR bumps the version to ${{ steps.version.outputs.version_number }} in: |
| 56 | + - `podman/version.py` |
| 57 | + - `podman/tests/__init__.py` |
| 58 | + - `plans/main.fmf` |
| 59 | +
|
| 60 | + Other files (`pyproject.toml`, `setup.cfg`, `Makefile`) derive the version dynamically from `podman/version.py`. |
| 61 | +
|
| 62 | + Once merged, a GitHub release will be automatically created with tag `${{ steps.version.outputs.version_tag }}`, which will trigger the [PyPI publish workflow](.github/workflows/publish-to-pypi.yml). |
0 commit comments