Skip to content

Commit 714a804

Browse files
authored
Add JFrog publish workflow for pyiceberg (#45)
# Rationale for this change Publish the pyiceberg package to the same JFrog Artifactory PyPI repository (`openhouse-pypi`) used by the OpenHouse data loader. The package is renamed from `pyiceberg` to `li-pyiceberg` to distinguish it from the upstream Apache release and follow LinkedIn's `li*` naming convention. The Python import (`import pyiceberg`) is unchanged. ## How it works 1. **tag** — reads the version from `pyproject.toml` as the initial version, then auto-increments the patch via git tags on each push to `li-0.11` (e.g. `v0.11.1`, `v0.11.2`, ...) 2. **build** — reuses `pypi-build-artifacts.yml` to build sdist and multi-platform wheels (Linux, Linux ARM, Windows, macOS Intel, macOS ARM) across Python 3.10–3.13 via cibuildwheel. Each wheel is validated by running `pytest tests/avro/test_decoder.py`. 3. **publish** — downloads all build artifacts and publishes to JFrog using `pypa/gh-action-pypi-publish`. Jobs are sequenced via `needs:` so publish waits for all matrix builds to complete. This does not publish to PyPI or TestPyPI. The existing upstream workflows (`nightly-pypi-build.yml`, `python-release.yml`) are gated by `github.repository == 'apache/iceberg-python'` and will not run in this fork. Requires `JFROG_USERNAME` and `JFROG_PYPI_API_TOKEN` secrets to be configured in this repo. ## Are these changes tested? Will be validated on the first push to `li-0.11` after secrets are configured. ## Are there any user-facing changes? No.
1 parent b78e54c commit 714a804

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: "Publish to JFrog"
2+
3+
on:
4+
push:
5+
branches:
6+
- 'li-0.11'
7+
8+
concurrency:
9+
group: jfrog-publish-${{ github.ref }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
tag:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
outputs:
21+
VERSION: ${{ steps.get-version.outputs.VERSION }}
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v6
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Install UV
29+
uses: astral-sh/setup-uv@v7
30+
31+
- name: Get initial version from pyproject.toml
32+
id: initial-version
33+
run: echo "VERSION=$(uv version --short)" >> "$GITHUB_OUTPUT"
34+
35+
- name: Bump version and push tag
36+
uses: anothrNick/github-tag-action@1.69.0
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
WITH_V: true
40+
DEFAULT_BUMP: patch
41+
INITIAL_VERSION: ${{ steps.initial-version.outputs.VERSION }}
42+
43+
- name: Get the latest tag
44+
id: get-version
45+
run: |
46+
latest_tag=$(git describe --tags --abbrev=0)
47+
VERSION=${latest_tag#v}
48+
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
49+
echo "Publishing version ${VERSION}"
50+
51+
build:
52+
needs: tag
53+
uses: ./.github/workflows/pypi-build-artifacts.yml
54+
with:
55+
VERSION: ${{ needs.tag.outputs.VERSION }}
56+
57+
publish:
58+
name: Publish to JFrog Artifactory
59+
needs: build
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Download all the artifacts
63+
uses: actions/download-artifact@v7
64+
with:
65+
merge-multiple: true
66+
path: dist/
67+
68+
- name: Publish to JFrog Artifactory PyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1
70+
with:
71+
repository-url: https://linkedin.jfrog.io/artifactory/api/pypi/openhouse-pypi
72+
user: ${{ secrets.JFROG_USERNAME }}
73+
password: ${{ secrets.JFROG_PYPI_API_TOKEN }}
74+
verbose: true

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
[project]
18-
name = "pyiceberg"
18+
name = "li-pyiceberg"
1919
version = "0.11.1"
2020
description = "Apache Iceberg is an open table format for huge analytic datasets"
2121
authors = [{ name = "Apache Software Foundation", email = "dev@iceberg.apache.org" }]

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
def test_version_format() -> None:
2222
from importlib import metadata
2323

24-
installed_version = metadata.version("pyiceberg")
24+
installed_version = metadata.version("li-pyiceberg")
2525

2626
assert __version__ == installed_version, (
2727
f"The installed version ({installed_version}) does not match the current codebase version ({__version__})."

0 commit comments

Comments
 (0)