Merge pull request #405 from epam/release/1.13 #33
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: Build & maybe upload PyPI package | |
on: | |
push: | |
branches: ["master"] | |
tags: ["*"] | |
paths: | |
- '**.py' | |
release: | |
types: | |
- published | |
paths: | |
- '**.py' | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
jobs: | |
build-package: | |
uses: ./.github/workflows/build-and-check-python-package.yml | |
# Upload to Test PyPI on every commit on main | |
release-test-pypi: | |
name: Publish dev package to test.pypi.org | |
environment: release-test-pypi | |
if: github.repository_owner == 'epam' && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: build-package | |
steps: | |
- name: Download packages built by build-and-inspect-python-package | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- name: Upload package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
# Upload to PyPI on every GitHub Release | |
release-pypi: | |
name: Publish released package to pypi.org | |
environment: release-pypi | |
if: github.repository_owner == 'epam' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
needs: build-package | |
steps: | |
- name: Download packages built by build-and-inspect-python-package | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- name: Upload package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |