Skip to content

Commit

Permalink
added python-ci-versioneer
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Jul 19, 2021
1 parent 9fc5e18 commit 617807e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Python package to PiPy. This makes use of Twine and is triggered when a push
# to the main branch occures. For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# and for details on the Autobump version section see:
# https://github.com/grst/python-ci-versioneer

name: Upload Python Package

Expand All @@ -20,10 +22,24 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Autobump version
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
PLACEHOLDER='version="develop"'
VERSION_FILE='setup.py'
# Grep checks that the placeholder is in the file. If grep doesn't find
# the placeholder then it exits with exit code 1 and github actions fails.
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$PLACEHOLDER/version=\"${VERSION}\"/g" "$VERSION_FILE"
shell: bash

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="paramak",
version="0.2.8",
version="develop",
author="The Paramak Development Team",
author_email="mail@jshimwell.com",
description="Create 3D fusion reactor CAD models based on input parameters",
Expand Down

0 comments on commit 617807e

Please sign in to comment.