diff --git a/.github/workflows/publish-python-packages.yml b/.github/workflows/publish-python-packages.yml new file mode 100644 index 00000000..d24324c3 --- /dev/null +++ b/.github/workflows/publish-python-packages.yml @@ -0,0 +1,42 @@ +name: Publish Python packages to Test PyPi + +on: + # Run on push when the version file has changed on selected branches. + push: + branches: + - master + - develop + - 'release/**' + paths: + - 'dvp/src/main/python/dlpx/virtualization/VERSION' + +jobs: + publish: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: [2.7] + package: [common, dvp, libs, platform, tools] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + # Install dependencies necessary for building and publishing the package. + - name: Install dependencies + run: | + pip install setuptools wheel twine + # Build each Python package and publish it to Test PyPi. + - name: Build and publish ${{ matrix.package }} package + working-directory: ${{ matrix.package }} + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.VSDK_PYPI_TOKEN }} + TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ + run: | + python setup.py sdist bdist_wheel + twine upload dist/* +