Merge pull request #47 from Omnipro-Solutions/develop #20
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: Generate Python Library & Publish on PYPI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-patch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip build | |
- name: Get next version | |
id: generate_release_tag | |
uses: phish108/autotag-action@1.1.53 | |
with: | |
github-token: ${{ secrets.TOKEN_GITHUB}} | |
with-v: "true" | |
bump: patch | |
- name: Update version in setup.py | |
run: sed -i 's/VERSION = "0.0.0"/VERSION = "${{ steps.generate_release_tag.outputs.new-tag }}"/g' setup.py | |
- name: Build package | |
run: python -m build | |
- name: Check Output Parameters | |
run: | | |
echo "Got tag name ${{ steps.generate_release_tag.outputs.new-tag }}" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
with: | |
tag_name: ${{ steps.generate_release_tag.outputs.new-tag }} | |
release_name: Release ${{ steps.generate_release_tag.outputs.new-tag }} | |
- name: Upload Release Assets | |
id: upload-release-assets | |
uses: dwenegar/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
assets_path: dist/ | |
- name: Publish package to Custom PYPI | |
run: | | |
pip install twine | |
twine upload --repository-url https://pypi.omni.pro/root/omni-pro-app/ -u ${{ secrets.DEVPI_USER }} -p ${{ secrets.DEVPI_PASSWORD }} dist/* |