Skip to content

Commit

Permalink
Add version to package
Browse files Browse the repository at this point in the history
  • Loading branch information
acostapazo committed Feb 5, 2020
1 parent 743f288 commit 74aabde
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
release:
types: [published]

env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PACKAGE_NAME: meiga

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -14,13 +19,18 @@ jobs:
with:
python-version: '3.x'
- name: Set RELEASE_VERSION
run: |
echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
- name: Update VERSION file
run: echo ${RELEASE_VERSION} > ${PACKAGE_NAME}/VERSION
- name: Install dependencies
run: pip install setuptools wheel twine
- name: Build and publish
run: |
echo ${RELEASE_VERSION} > VERSION
git add VERSION
- name: Commit files
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Git - Add VERSION File
run: git add ${PACKAGE_NAME}/VERSION
- name: Git - Commit VERSION File
run: |
git config --global user.email "[email protected]"
git config --global user.name "ALiCE Biometrics"
Expand All @@ -29,15 +39,3 @@ jobs:
uses: alice-biometrics/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_ACCESS_TOKEN }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
File renamed without changes.
6 changes: 6 additions & 0 deletions meiga/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import os

from meiga.public_api import *
from meiga import public_api

ROOT_PATH = os.path.abspath(os.path.dirname(__file__))

__version__ = open(f"{ROOT_PATH}/VERSION", "r").read()[:-1]

__all__ = public_api.__all__
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
PACKAGE_NAME = "meiga"
VERSION = open("VERSION", "r").read()
VERSION = open("meiga/VERSION", "r").read()

# The text of the README file
with open(os.path.join(CURRENT_DIR, "README.md")) as fid:
Expand Down

0 comments on commit 74aabde

Please sign in to comment.