Skip to content

Commit 77fa781

Browse files
committed
Fix release flow
(cherry picked from commit 7e4f61b)
1 parent a1ba5cc commit 77fa781

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,51 @@ jobs:
6969
- name: Test migrations across versions
7070
run: bash scripts/test-migrations.sh mariadb
7171
publish-python-package:
72+
# This previously used the publish_to_pypi.yml workflow, but PyPI
73+
# doesn't support trusted publishing with reusable workflows yet.
74+
# See https://github.com/pypi/warehouse/issues/11096
7275
if: github.repository == 'zenml-io/zenml'
76+
name: Publish Python 🐍 package 📦 to PyPI
7377
needs:
7478
- setup-and-test
7579
- sqlite-db-migration-testing
7680
- mysql-db-migration-testing
7781
- mariadb-db-migration-testing
78-
uses: ./.github/workflows/publish_to_pypi.yml
79-
secrets: inherit
82+
runs-on: ubuntu-latest
83+
environment: release
84+
permissions:
85+
# This permission is required for trusted publishing.
86+
id-token: write
87+
contents: read
88+
env:
89+
ZENML_DEBUG: 1
90+
ZENML_ANALYTICS_OPT_IN: false
91+
PYTHONIOENCODING: utf-8
92+
steps:
93+
- uses: actions/[email protected]
94+
- name: Get the version from the github tag ref
95+
id: get_version
96+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
97+
- name: Set up Python
98+
uses: actions/[email protected]
99+
with:
100+
python-version: '3.9'
101+
- name: Install uv
102+
uses: astral-sh/setup-uv@v6
103+
with:
104+
version: 0.8.14
105+
- name: Include latest dashboard
106+
run: bash scripts/install-dashboard.sh
107+
- name: Verify version
108+
run: |-
109+
if [ "$(cat src/zenml/VERSION)" != "$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" ]; then
110+
echo "Version mismatch between src/zenml/VERSION and git tag"
111+
exit 1
112+
fi
113+
- name: Build package
114+
run: uv build
115+
- name: Publish package distributions to PyPI
116+
uses: pypa/gh-action-pypi-publish@release/v1
80117
wait-for-package-release:
81118
runs-on: ubuntu-latest
82119
needs: publish-python-package

0 commit comments

Comments
 (0)