diff --git a/.github/workflows/nightly-pypi-build.yml b/.github/workflows/nightly-pypi-build.yml new file mode 100644 index 0000000000..e7a32a3d0a --- /dev/null +++ b/.github/workflows/nightly-pypi-build.yml @@ -0,0 +1,85 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: "Nightly PyPI Build" + +on: + schedule: + - cron: "0 0 * * *" # Runs at midnight UTC every day + workflow_dispatch: # Allows manual triggering + +jobs: + set-version: + if: github.repository == 'apache/iceberg-python' # Only run for apache repo + runs-on: ubuntu-latest + outputs: + VERSION: ${{ steps.set-version.outputs.VERSION }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install Poetry + run: make install-poetry + + - name: Set version + id: set-version + run: | + CURRENT_VERSION=$(poetry version --short) + TIMESTAMP=$(date +%Y%m%d%H%M%S) + echo "VERSION=${CURRENT_VERSION}.dev${TIMESTAMP}" >> "$GITHUB_OUTPUT" + + - name: Debug version + run: echo "Publishing version ${{ steps.set-version.outputs.VERSION }}" + + nightly-build: + needs: set-version + uses: ./.github/workflows/pypi-build-artifacts.yml + with: + version: ${{ needs.set-version.outputs.VERSION }} + testpypi-publish: + name: Publish to TestPypi + needs: + - nightly-build + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/pyiceberg + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: dist/ + - name: List downloaded artifacts + run: ls -R dist/ + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + verbose: true diff --git a/.github/workflows/pypi-build-artifacts.yml b/.github/workflows/pypi-build-artifacts.yml index 274528c3bd..288e5c0046 100644 --- a/.github/workflows/pypi-build-artifacts.yml +++ b/.github/workflows/pypi-build-artifacts.yml @@ -25,9 +25,6 @@ on: VERSION: required: true type: string - RC: - required: true - type: string jobs: pypi-build-artifacts: @@ -35,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ] + os: [ ubuntu-22.04, windows-2022, macos-13, macos-14 ] steps: - uses: actions/checkout@v4 @@ -56,8 +53,7 @@ jobs: - name: Set version with RC env: VERSION: ${{ inputs.VERSION }} - RC: ${{ inputs.RC }} - run: python -m poetry version "${{ env.VERSION }}rc${{ env.RC }}" # e.g., 0.8.0rc1 + run: python -m poetry version "${{ env.VERSION }}" # Publish the source distribution with the version that's in # the repository, otherwise the tests will fail @@ -97,6 +93,6 @@ jobs: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: "pypi-release-candidate-${{ inputs.VERSION }}rc${{ inputs.RC }}" + name: "pypi-release-candidate-${{ inputs.VERSION }}" pattern: pypi-release-candidate* delete-merged: true diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 8c2216d8a7..a6175ead9e 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -121,8 +121,7 @@ jobs: - validate-library-version uses: ./.github/workflows/svn-build-artifacts.yml with: - version: ${{ needs.validate-inputs.outputs.VERSION }} - rc: ${{ needs.validate-inputs.outputs.RC }} + version: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} # PyPi pypi-build-artifacts: @@ -131,5 +130,4 @@ jobs: - validate-library-version uses: ./.github/workflows/pypi-build-artifacts.yml with: - version: ${{ needs.validate-inputs.outputs.VERSION }} - rc: ${{ needs.validate-inputs.outputs.RC }} + version: ${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }} diff --git a/.github/workflows/svn-build-artifacts.yml b/.github/workflows/svn-build-artifacts.yml index 336ece68f4..8336b46940 100644 --- a/.github/workflows/svn-build-artifacts.yml +++ b/.github/workflows/svn-build-artifacts.yml @@ -25,9 +25,6 @@ on: VERSION: required: true type: string - RC: - required: true - type: string jobs: svn-build-artifacts: @@ -35,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ] + os: [ ubuntu-22.04, windows-2022, macos-13, macos-14 ] steps: - uses: actions/checkout@v4 @@ -91,6 +88,6 @@ jobs: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 with: - name: "svn-release-candidate-${{ inputs.VERSION }}rc${{ inputs.RC }}" + name: "svn-release-candidate-${{ inputs.VERSION }}" pattern: svn-release-candidate* delete-merged: true