Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] add testpypi nightly build #1601

Merged
merged 7 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/nightly-pypi-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#
# 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
kevinjqliu marked this conversation as resolved.
Show resolved Hide resolved

jobs:
set-version:
if: github.repository == 'apache/iceberg-python' # Only run for apache repo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified that workflow is skipped on my forked repo
https://github.com/kevinjqliu/iceberg-python/actions/runs/13123573377

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.set-version.outputs.VERSION }}
RC: ${{ steps.set-version.outputs.RC }}
kevinjqliu marked this conversation as resolved.
Show resolved Hide resolved
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: Extract version and rc
id: set-version
run: |
VERSION=$(poetry version --short)
RC="$(date +%Y%m%d)"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "RC=$RC" >> "$GITHUB_OUTPUT"

- name: Debug version and rc
run: echo "Publishing version ${{ steps.set-version.outputs.VERSION }}rc${{ steps.set-version.outputs.RC }}"

nightly-build:
needs: set-version
uses: ./.github/workflows/pypi-build-artifacts.yml
with:
version: ${{ needs.set-version.outputs.VERSION }} # i.e. 0.9.0
rc: ${{ needs.set-version.outputs.RC }} # i.e. 20250203

testpypi-publish:
name: Publish to TestPypi
needs:
- nightly-build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/pyiceberg
Fokko marked this conversation as resolved.
Show resolved Hide resolved

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/
Comment on lines +78 to +79
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping that we could leave out this kind of debug statements. But it looks like the merge job doesn't mention the actual files: https://github.com/kevinjqliu/iceberg-python/actions/runs/13119881319/job/36603748563

- 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
2 changes: 1 addition & 1 deletion .github/workflows/pypi-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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 ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with macos-15? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macos-14, macos-15 are the same hardware so produce the same artifacts. i was getting some error uploading to pypi due to

pypi zipfile.BadZipFile: Bad magic number for central directory

removing macos-15 worked 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, let's see if we can restore macos-15 at a later moment


steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/svn-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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
Expand Down