Skip to content

Commit

Permalink
Get version from env in setup (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrergeru authored Sep 20, 2023
1 parent 5c0fc94 commit 5d65a88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ jobs:
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
run: |
export PYTHON_MOIRA_CLIENT_VERSION=`echo ${GITHUB_REF_NAME} \
| sed -r 's#v([0-9]+\.[0-9]\.[0-9])#\1#g' \
| sed 's#[^a-zA-Z0-9_\.\-]#_#g'`
echo $PYTHON_MOIRA_CLIENT_VERSION
python -m build --sdist --wheel --outdir dist/
# make this available for test
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
Expand All @@ -40,5 +41,7 @@ jobs:
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
env:
PYTHON_MOIRA_CLIENT_VERSION: ${{ github.ref_name }}
with:
password: ${{ secrets.PYPI_API_TOKEN_V2 }}
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from distutils.core import setup
import os

with open('requirements.txt') as f:
required = f.read().splitlines()

setup(
name='moira-python-client',
version='4.0.2',
version=os.environ['PYTHON_MOIRA_CLIENT_VERSION'],
description='Client for Moira - Alerting system based on Graphite data',
keywords='moira monitoring client metrics alerting',
long_description="""
Expand Down

0 comments on commit 5d65a88

Please sign in to comment.