Skip to content

Commit

Permalink
Merge pull request #25 from iiif-prezi/deploy-on-release
Browse files Browse the repository at this point in the history
Getting version number from release version
  • Loading branch information
glenrobson authored Jan 28, 2022
2 parents 1a4584d + 1bb5fdd commit 6a264eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/PyPi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Python 🐍 distributions 📦 to PyPI on Release

on:
release:
types: [published]
types: [released]

jobs:
build-n-publish:
Expand All @@ -16,6 +16,9 @@ jobs:
with:
python-version: 3.9

- name: Setup version
run: echo "${{ github.event.release.tag_name }}" > version.txt

- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and a source tarball
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/TestPyPi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish Python 🐍 distributions 📦 to TestPyPI on Tag creation

on:
push:
tags:
- '*'
release:
types: [prereleased]

jobs:
build-n-publish:
Expand All @@ -16,6 +15,9 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Setup version
run: echo "${{ github.event.release.tag_name }}" > version.txt

- name: Install pypa/build
run: python -m pip install build --user
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

# read the contents of your README file
from pathlib import Path
import os
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

VERSION = '0.0.2.4'
if os.path.exists("version.txt"):
VERSION = (this_directory / "version.txt").read_text().strip()
else:
VERSION = "local_test_version"

REQUIREMENTS = [
"pydantic"
]
Expand Down

0 comments on commit 6a264eb

Please sign in to comment.