Release
A release is a tag vX.Y.Z on main.
Steps
- Update
CHANGELOG.md. - Set
__version__insrc/pysparkonk8s/provider_info.pyandversionandappVersionincharts/pysparkonk8s-rbac/Chart.yaml. The chart version must equal the tag on every release, even when the chart did not change, because the workflow checks it. - Bump the version literals in the docs and the README: the chart
--versionin the install commands, and the driver image tags in the examples. - Optionally dry-run the pre-flight from the Actions tab (workflow
Release, Run workflow) on the branch. It runstest,buildandbuild-checkand skips everything that publishes. - Merge to
main, then push the tag:
git tag vX.Y.Z
git push origin vX.Y.Z
What the workflow does
.github/workflows/release.yml runs on the tag, in this order:
testruns the full CI (ci.ymlwithfull: true).buildfails unless the tag matches__version__insrc/pysparkonk8s/provider_info.pyandversionincharts/pysparkonk8s-rbac/Chart.yaml. It builds the package and uploadsdistas an artifact.build-checkbuilds every driver image fromdocker/images.jsonon a native runner for each of linux/amd64 and linux/arm64, with nothing pushed, and runsimport pysparkonk8s, pyspark, airflowandjava -versionin it. A broken image therefore fails before anything is published.publishneedsbuildandbuild-checkand runs in thepypienvironment. It publishesairflow-provider-pysparkonk8sto PyPI with trusted publishing (files already on PyPI are skipped, so a rerun is safe) and creates the GitHub release if it does not exist, withdist/*attached and the matchingCHANGELOG.mdsection as notes.imageandchartrun only afterpublishsucceeded, so nothing is pushed to GHCR when PyPI failed:imagebuilds the driver image for each row ofdocker/images.jsonfor linux/amd64 and linux/arm64, from the wheel built bybuild, and pushesghcr.io/sdaberdaku/pysparkonk8s/driver:<version>-airflow<airflow>-python<minor>. The row withlatest: truealso gets:<version>and:latest.chartpushes the RBAC chart tooci://ghcr.io/sdaberdaku/charts/pysparkonk8s-rbac.
publish, image and chart run only for tags starting with v. When the workflow is started by hand, only test, build and build-check run, which makes it a dry run.
One-time setup
- On PyPI, add a pending publisher for the project
airflow-provider-pysparkonk8s: ownersdaberdaku, repositorypysparkonk8s, workflow file namerelease.yml, environmentpypi. - In the repository settings, create the environment
pypi, limited to tagsv*. - In the repository settings, set Pages to deploy from GitHub Actions.
- After the first release, set the GHCR packages
pysparkonk8s/driverandcharts/pysparkonk8s-rbacto public and link them to the repository in the package settings.