Skip to content

Release v1.5.2

Release v1.5.2 #3

Workflow file for this run

name: Create Release and Publish to PyPI
on:
push:
branches:
- master
workflow_dispatch:
jobs:
check-version-change:
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.version_changed.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check if version.py has changed
id: version_changed
uses: dorny/paths-filter@v2
with:
filters: |
version:
- 'pyaim/version.py'
create-release:
if: ${{ needs.check-version-change.outputs.version_changed == 'true' }}
needs: check-version-change
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Extract version
id: get_version
run: |
VERSION=$(grep -oP '(?<=^__version__ = ")([^"]+)' pyaim/version.py)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "::set-output name=VERSION::$VERSION"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: false
prerelease: false
publish-to-pypi:
if: ${{ needs.check-version-change.outputs.version_changed == 'true' }}
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel twine
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*