|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | +name: "Nightly PyPI Build" |
| 21 | + |
| 22 | +on: |
| 23 | + schedule: |
| 24 | + - cron: "0 0 * * *" # Runs at midnight UTC every day |
| 25 | + workflow_dispatch: # Allows manual triggering |
| 26 | + |
| 27 | +jobs: |
| 28 | + set-version: |
| 29 | + if: github.repository == 'apache/iceberg-python' # Only run for apache repo |
| 30 | + runs-on: ubuntu-latest |
| 31 | + outputs: |
| 32 | + VERSION: ${{ steps.set-version.outputs.VERSION }} |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 1 |
| 37 | + |
| 38 | + - uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: 3.12 |
| 41 | + |
| 42 | + - name: Install Poetry |
| 43 | + run: make install-poetry |
| 44 | + |
| 45 | + - name: Set version |
| 46 | + id: set-version |
| 47 | + run: | |
| 48 | + CURRENT_VERSION=$(poetry version --short) |
| 49 | + TIMESTAMP=$(date +%Y%m%d%H%M%S) |
| 50 | + echo "VERSION=${CURRENT_VERSION}.dev${TIMESTAMP}" >> "$GITHUB_OUTPUT" |
| 51 | +
|
| 52 | + - name: Debug version |
| 53 | + run: echo "Publishing version ${{ steps.set-version.outputs.VERSION }}" |
| 54 | + |
| 55 | + nightly-build: |
| 56 | + needs: set-version |
| 57 | + uses: ./.github/workflows/pypi-build-artifacts.yml |
| 58 | + with: |
| 59 | + version: ${{ needs.set-version.outputs.VERSION }} |
| 60 | + testpypi-publish: |
| 61 | + name: Publish to TestPypi |
| 62 | + needs: |
| 63 | + - nightly-build |
| 64 | + runs-on: ubuntu-latest |
| 65 | + environment: |
| 66 | + name: testpypi |
| 67 | + url: https://test.pypi.org/p/pyiceberg |
| 68 | + |
| 69 | + permissions: |
| 70 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 71 | + |
| 72 | + steps: |
| 73 | + - name: Download all the artifacts |
| 74 | + uses: actions/download-artifact@v4 |
| 75 | + with: |
| 76 | + merge-multiple: true |
| 77 | + path: dist/ |
| 78 | + - name: List downloaded artifacts |
| 79 | + run: ls -R dist/ |
| 80 | + - name: Publish to TestPyPI |
| 81 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 82 | + with: |
| 83 | + repository-url: https://test.pypi.org/legacy/ |
| 84 | + skip-existing: true |
| 85 | + verbose: true |
0 commit comments