Skip to content

Commit

Permalink
e version file for auto update on release
Browse files Browse the repository at this point in the history
Co-Authored-By: 4dsherwood <[email protected]>
Co-Authored-By: Bernhard Raml <[email protected]>
  • Loading branch information
3 people committed May 8, 2022
1 parent cd3682f commit 2dc817a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Determine version from git tag
id: version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: set version
run: |
rm ./version.py
echo version_number = \"${{ steps.version.outputs.tag }}\" > ./version.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@

import os
import codecs
import re
from pathlib import Path

from setuptools import setup


def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()

HERE = Path(__file__).parent
_version_file_contents = (HERE / "version.py").read_text()
matched = re.search(r'"(.*)"', _version_file_contents)
VERSION = matched.group(1) if matched is not None else "UNKNOWN VERSION"

setup(
name='pytest-approvaltests',
version='0.2.3',
version=VERSION,
author='Emily Bache',
author_email='[email protected]',
maintainer='Emily Bache',
Expand Down
1 change: 1 addition & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version_number = "v5.0.1"

0 comments on commit 2dc817a

Please sign in to comment.