Python pre-release #35
Workflow file for this run
This file contains hidden or 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
| # This workflow builds a pre-release version of the Python API for Pathling and deploys it to PyPI. | |
| name: "Python pre-release" | |
| # This workflow is triggered manually, and requires the input of a segment identifier. This will be | |
| # appended to the version, e.g. 6.1.3-dev0. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| segmentIdentifier: | |
| description: "Pre-release identifier" | |
| required: true | |
| default: ".dev0" | |
| env: | |
| # The add-exports and add-opens flags are required for Java 21 | |
| MAVEN_OPTS: --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED | |
| jobs: | |
| deploy-python-pre-release: | |
| name: Python pre-release | |
| environment: pypi | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| # This is required so that git-commit-id-plugin can find the latest tag. | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: "zulu" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache Python packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('lib/python/requirements/dev.txt', 'lib/python/requirements/package.txt') }} | |
| - name: Run deploy goal (pre-release) | |
| env: | |
| PYSPARK_PYTHON: ${{ steps.python-install.outputs.python-path }} | |
| PYSPARK_DRIVER_PYTHON: ${{ steps.python-install.outputs.python-path }} | |
| TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
| run: | | |
| mvn --batch-mode deploy \ | |
| -pl lib/python -am \ | |
| -PpythonPreRelease \ | |
| -DskipTests \ | |
| -Dpathling.pyapi.version.qualifier=${{ github.event.inputs.segmentIdentifier }} | |
| timeout-minutes: 30 |