Skip to content

Use modern way for GITHUB_OUTPUT #3

Use modern way for GITHUB_OUTPUT

Use modern way for GITHUB_OUTPUT #3

Workflow file for this run

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 }}