Skip to content

Conversation

kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Jun 17, 2025

Which issue does this PR close?

What changes are included in this PR?

Changes

  • Trigger publish workflow only by matching specific tag names (v<major>.<minor>.<patch> or v<major>.<minor>.<patch>-rc.<release_candidate>) instead of all tags
  • Add a step in pypi workflow to again validate the tag name
  • Edit pypi workflow to override the Cargo version for RC. This allows us to upload to pypi as pre-release

Are these changes tested?

Yes, tested against personal fork.

Tested

  • push invalid tag, i.e. should-not-trigger. ✅ does not trigger the publish job
  • push RC tag, i.e. v0.6.0-rc.1. ✅ triggers publish job and pypi job
  • push release tag, i.e. v0.6.0. ✅ triggers publish job and pypi job

For both v0.6.0-rc.1 and v0.6.0, verified the generated artifacts (wheels-sdist and wheels-ubuntu-latest-armv7l) locally for the correctly set python version number.

@@ -20,7 +20,9 @@ name: Publish
on:
push:
tags:
- "*"
# Trigger this workflow when tag follows the versioning format: v<major>.<minor>.<patch>-rc.<release_candidate>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/allow-pypi-prerelease branch from 9d00a95 to 63cd745 Compare June 23, 2025 04:30
@@ -28,7 +28,7 @@ env:
rust_msrv: "1.85"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}-${{ github.event_name }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

after changing github.ref -> github.event.workflow_run.head_branch in #1444, this was missed.

just a minor improvement

@kevinjqliu kevinjqliu marked this pull request as ready for review June 23, 2025 15:41
@kevinjqliu
Copy link
Contributor Author

Most important thing here is that for a RC tag push, i.e. v0.6.0-rc.1, the generate pypi artifacts is set to a pre-release version.

For example, wheels-sdist from test run is set to Version: 0.6.0rc1

Comment on lines +25 to +26
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
Copy link
Contributor

Choose a reason for hiding this comment

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

I consider myself a bit of a regex connoisseur.

Suggested change
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
- "v\d+.\d+.\d+"
- "v\d+.\d+.\d+-rc.\d+"
image

Copy link
Contributor Author

@kevinjqliu kevinjqliu Jun 23, 2025

Choose a reason for hiding this comment

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

fun fact! the on.push.tags syntax here doesnt support regex, its a "filter pattern"

from https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore,

The branches, branches-ignore, tags, and tags-ignore keywords accept glob patterns that use characters like *, **, +, ?, ! and others to match more than one branch or tag name. If a name contains any of these characters and you want a literal match, you need to escape each of these special characters with \. For more information about glob patterns, see the [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet).

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

@kevinjqliu kevinjqliu merged commit c85d980 into apache:main Jun 24, 2025
26 of 27 checks passed
@kevinjqliu kevinjqliu deleted the kevinjqliu/allow-pypi-prerelease branch June 24, 2025 15:36
kevinjqliu added a commit that referenced this pull request Jul 22, 2025
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->

- Closes #.

## What changes are included in this PR?
See
[comment](#1331 (comment))
for context
Previously used `cargo-edit` but it does not allow setting version from
`0.6.0` -> `0.6.0-rc1`.

This PR changes the github action to use `toml-cli` to manually override
and set the version in the `binding/python/Cargo.toml` so that we can
build pre-release artifacts to push to pypi.

<!--
Provide a summary of the modifications in this PR. List the main changes
such as new features, bug fixes, refactoring, or any other updates.
-->

## Are these changes tested?

<!--
Specify what test covers (unit test, integration test, etc.).

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

Yes, similar to #1449

Pushed this PR as the `main` branch in my fork 
Create a new tag and push to fork to trigger CI
```
git tag "v0.6.0-rc.2" -m "v0.6.0-rc.2"
git push kevinjqliu v0.6.0-rc.2
```
Verify that python artifacts are build correctly with pre-release tag,
https://github.com/kevinjqliu/iceberg-rust/actions/runs/16436181005
- downloaded `wheels-sdist`, verified correct version in `PKG-INFO` but
not in `Cargo.toml`. I think this is fine
- downloaded `wheels-ubuntu-latest-armv7l` and verified the `METADATA`
file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

we should publish rc to pypi as part of the release process
2 participants