Skip to content

Commit 6fbeb32

Browse files
authored
[fix] nightly pypi build for pyiceberg_core (#983)
Follow up to #948 I found a bug in the nightly pypi build where the version timestamp changes within the jobs, causing a single run to push multiple versions. This PR fixes the issue by setting the version timestamp once for the entire workflow and then pass it down to individual jobs. This should ensure a consistency version Workflow run: https://github.com/apache/iceberg-rust/actions/runs/13460497360 Testpypi: https://test.pypi.org/project/pyiceberg-core-kevinliu/#history Tested on my fork: Worfklow run: https://github.com/kevinjqliu/iceberg-rust/actions/runs/13461643730 Testpypi on my fork: https://test.pypi.org/project/pyiceberg-core-kevinliu/0.4.0.dev20250221170617/#files
1 parent e4b2810 commit 6fbeb32

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

.github/actions/overwrite-package-version/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
# under the License.
1717

1818
name: 'Update Package Version'
19-
description: 'Updates pyproject.toml version with timestamp'
19+
description: 'Updates pyproject.toml version with a provided timestamp'
20+
inputs:
21+
timestamp:
22+
description: 'Timestamp to override to the package version'
23+
required: true
2024
runs:
2125
using: "composite"
2226
steps:
@@ -33,8 +37,7 @@ runs:
3337
shell: bash
3438
run: |
3539
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/pyproject.toml')['project']['version'])")
36-
TIMESTAMP=$(date +%Y%m%d%H%M%S)
37-
NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
40+
NEW_VERSION="${CURRENT_VERSION}.dev${{ inputs.timestamp }}"
3841
NEW_VERSION=$NEW_VERSION python -c "
3942
import toml
4043
import os

.github/workflows/release_python_nightly.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,40 @@ permissions:
2929
contents: read
3030

3131
jobs:
32+
set-version:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
timestamp: ${{ steps.set-ts.outputs.TIMESTAMP }}
36+
steps:
37+
- name: Generate version timestamp
38+
id: set-ts
39+
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT"
40+
3241
sdist:
42+
needs: set-version
3343
if: github.repository == 'apache/iceberg-rust' # Only run for apache repo
3444
runs-on: ubuntu-latest
3545
steps:
3646
- uses: actions/checkout@v4
37-
38-
- uses: ./.github/actions/overwrite-package-version # overwrite the pacakge version with current timestamp
47+
48+
- uses: ./.github/actions/overwrite-package-version # Overwrite package version with timestamp
49+
with:
50+
timestamp: ${{ needs.set-version.outputs.TIMESTAMP }}
3951

4052
- uses: PyO3/maturin-action@v1
4153
with:
4254
working-directory: "bindings/python"
4355
command: sdist
4456
args: -o dist
57+
4558
- name: Upload sdist
4659
uses: actions/upload-artifact@v4
4760
with:
4861
name: wheels-sdist
4962
path: bindings/python/dist
5063

5164
wheels:
65+
needs: set-version
5266
if: github.repository == 'apache/iceberg-rust' # Only run for apache repo
5367
runs-on: "${{ matrix.os }}"
5468
strategy:
@@ -61,21 +75,28 @@ jobs:
6175
- { os: ubuntu-latest, target: "armv7l" }
6276
steps:
6377
- uses: actions/checkout@v4
64-
- uses: ./.github/actions/overwrite-package-version # overwrite the pacakge version with current timestamp
78+
79+
- uses: ./.github/actions/overwrite-package-version # Overwrite package version with timestamp
80+
with:
81+
timestamp: ${{ needs.set-version.outputs.TIMESTAMP }}
82+
6583
- uses: actions/setup-python@v5
6684
with:
6785
python-version: 3.9
86+
6887
- name: Setup Rust toolchain
6988
uses: ./.github/actions/setup-builder
7089
with:
7190
rust-version: ${{ env.rust_msrv }}
91+
7292
- uses: PyO3/maturin-action@v1
7393
with:
7494
target: ${{ matrix.target }}
7595
manylinux: ${{ matrix.manylinux || 'auto' }}
7696
working-directory: "bindings/python"
7797
command: build
7898
args: --release -o dist
99+
79100
- name: Upload wheels
80101
uses: actions/upload-artifact@v4
81102
with:

0 commit comments

Comments
 (0)