Skip to content

Commit

Permalink
Merge pull request #6 from woodtechie1428/dev
Browse files Browse the repository at this point in the history
autobump version
  • Loading branch information
woodtechie1428 authored Sep 7, 2021
2 parents b34bcc4 + 9809214 commit 3c0a139
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types: [created]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-18.04

steps:
Expand All @@ -16,6 +16,18 @@ jobs:
with:
python-version: 3.7

- 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='src/securityscorecard_api/version2.py'
# ensure the placeholder is there. If grep doesn't find the placeholder
# it exits with exit code 1 and github actions aborts the build.
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
shell: bash

- name: Install pypa/build
run: >-
python -m
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
with open("README.md", "r") as fh:
long_description = fh.read()

exec(open('src/securityscorecard_api/version.py').read())
exec(open('src/securityscorecard_api/version2.py').read())

setup(
name="securityscorecard_api",
Expand Down
1 change: 1 addition & 0 deletions src/securityscorecard_api/version2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "develop"

0 comments on commit 3c0a139

Please sign in to comment.