12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- name: Bump version
- on:
- workflow_dispatch:
- inputs:
- bump_rule:
- type: choice
- description: How to bump the project's version (see https://python-poetry.org/docs/cli/#version)
- options:
- - patch
- - minor
- - major
- - prepatch
- - preminor
- - premajor
- - prerelease
- required: true
- jobs:
- bump_version:
- name: "Bump version and create changelog"
- if: "!startsWith(github.event.head_commit.message, 'bump:')"
- runs-on: ubuntu-latest
- env:
- CI_COMMIT_EMAIL: "ci-runner@faostat-data-primap.invalid"
- steps:
- - name: Check out repository
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
-
-
-
-
- - uses: ./.github/actions/setup
- with:
- python-version: "3.11"
- venv-id: "bump"
- poetry-dependency-install-flags: "--only main"
- - name: Install towncrier
- run: |
- poetry run pip install towncrier
- - name: Create bump and changelog
- run: |
- git config --global user.name "$GITHUB_ACTOR"
- git config --global user.email "$CI_COMMIT_EMAIL"
-
- BASE_VERSION=`poetry version -s`
- NEW_VERSION=`poetry version -s ${{ github.event.inputs.bump_rule }}`
- echo "Bumping version $BASE_VERSION > $NEW_VERSION"
- poetry run towncrier build --yes --version v$NEW_VERSION
- git commit -a -m "bump: version $BASE_VERSION -> $NEW_VERSION"
- git tag v$NEW_VERSION
-
-
- BASE_VERSION=`poetry version -s`
- NEW_VERSION=`poetry version -s prerelease`
- echo "Bumping version $BASE_VERSION > $NEW_VERSION"
- git commit -a -m "bump(pre-release): version $BASE_VERSION > $NEW_VERSION"
- git push && git push --tags
|