Use modern way for GITHUB_OUTPUT #3
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: Automatically bump the package version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
bump: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
- name: Install dependencies | |
run: | | |
pip install setuptools_scm | |
- name: Figure out the next tag | |
shell: python | |
id: get_next_tag | |
run: | | |
import os | |
import setuptools_scm | |
from packaging import version | |
v = version.parse(setuptools_scm.get_version()) | |
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: | |
print(f'tag=v{v.major}.{v.minor + 1}.0', file=fh) | |
- name: Debug the next tag | |
run: echo ${{ steps.get_next_tag.outputs.tag }} | |
- uses: rickstaa/action-create-tag@v1 | |
id: "tag_create" | |
with: | |
tag: ${{ steps.get_next_tag.outputs.tag }} |