Merge branch 'feature/add_atecc608_ecdsa_example' into 'master' #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyPI release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_and_upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.7' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip build setuptools twine | |
- name: Build and upload esp-cryptoauth-utility ${{ github.event.release.tag_name }} | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PROJECT_TOKEN }} | |
working-directory: ./esp_cryptoauth_utility | |
run: | | |
PUBLISHED_VERSION=$(curl https://pypi.org/pypi/esp-cryptoauth-utility/json 2>/dev/null | jq -r '.info.version') | |
CURRENT_VERSION=$(python setup.py --version 2>/dev/null) | |
if [ "$PUBLISHED_VERSION" == "$CURRENT_VERSION" ]; then | |
echo "Version ${PUBLISHED_VERSION} already published, skipping..." | |
exit 0 | |
else | |
echo "Packaging and publishing new esp-cryptoauth-utility version: ${CURRENT_VERSION}" | |
python setup.py sdist | |
tar -ztvf dist/* | |
twine upload dist/* | |
fi |