Skip to content

Bump cryptography from 37.0.2 to 41.0.4 (#475) #165

Bump cryptography from 37.0.2 to 41.0.4 (#475)

Bump cryptography from 37.0.2 to 41.0.4 (#475) #165

name: Publish
on:
push:
branches:
- main
jobs:
build-n-publish:
name: Build and publish koku-nise to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.2.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4.4.0
with:
python-version: 3.8
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pipenv-setup setuptools wheel twine chardet vistir==0.6.1
- name: Build and publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
set -e
VERSION=$(python setup.py --version)
if [ ! -z $(git tag -l "${VERSION}") ]; then
echo "Tag already exists, doing nothing";
exit_code=1
elif [ -z "$(pipenv-setup check)" ]; then
echo "setup.py out of sync with Pipfile"
exit_code=1
else
echo "Creating tag ${VERSION}";
git config --local user.email "cost-mgmt@redhat.com"
git config --local user.name "Koku-Nise Release Action"
git tag ${VERSION};
git push origin --tags;
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
exit_code=0
fi
exit $exit_code