GH Actions: Deploy sdists to PyPI
Closed this issue · 17 comments
We extend the sdist.yml workflow from #32403 so that it builds sdists for PyPI using make pypi-sdists (from #29039).
This is run on release tags.
When the secret SAGEMATH_PYPI_API_TOKEN exists and the sdists were successfully created, it then proceeds to publish the sdists to PyPI using https://github.com/pypa/gh-action-pypi-publish
At the moment, the secret SAGEMATH_PYPI_API_TOKEN is only available in the repository https://github.com/mkoeppe/sage; in response to a release tag pushed to it, the workflow has successfully built the 9.5.beta6 release sdists (+ this branch): https://github.com/mkoeppe/sage/runs/4200645206?check_suite_focus=true and deployed to PyPI (see, for example https://pypi.org/project/sagemath-standard/9.5b6/)
Later we can move the deployment to https://github.com/sagemath/sage, simply by providing a secret SAGEMATH_PYPI_API_TOKEN to it. (We may want to add a safety check to the workflow that avoids pushing a release that hasn't had a release candidate.)
Depends on #29039
Depends on #32403
CC: @dimpase @jhpalmieri @kiwifb @tobiasdiez
Component: distribution
Author: Matthias Koeppe
Branch: cd51972
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/32062
Description changed:
---
+++
@@ -1 +1,3 @@
... after building them with `make pypi-sdists` (from #29039)
+
+https://github.com/pypa/gh-action-pypi-publishDescription changed:
---
+++
@@ -1,3 +1,7 @@
-... after building them with `make pypi-sdists` (from #29039)
+... after building them with `make pypi-sdists` (from #29039).
https://github.com/pypa/gh-action-pypi-publish
+
+This can be added to the `sdist.yml` workflow from #32403.
+
+We may want to add a safety check that avoids pushing a release that hasn't had a release candidate.Author: Matthias Koeppe
Last 10 new commits:
aeca1a0 | Makefile (pypi-sdists): Add sage_setup |
cd3dce9 | pkgs/sage-conf_pypi/setup.py: Update directory of configured sage_conf.py |
c695921 | pkgs/sage-conf/sage_conf.py.in (SAGE_SPKG_WHEELS): Update so it works if SAGE_VENV != SAGE_LOCAL |
cebcda3 | Merge tag '9.5.beta4' into t/29039/pip_installable_package_sage_bootstrap |
0026892 | Merge tag '9.5.beta5' into t/29039/pip_installable_package_sage_bootstrap |
a16df32 | Merge #29039 |
1261494 | .github/workflows/sdist.yml (deploy_sdists_pypi): New |
a21cb3c | Makefile (pypi-sdists): Remove duplication of sage_setup |
099b385 | .github/workflows/sdist.yml: Only attempt to upload if secrets.SAGEMATH_PYPI_API_TOKEN is present |
899d8cb | .github/workflows/sdist.yml: Fix up test whether token is present |
Description changed:
---
+++
@@ -1,7 +1,9 @@
-... after building them with `make pypi-sdists` (from #29039).
+We extend the `sdist.yml` workflow from #32403 so that it builds sdists for PyPI using `make pypi-sdists` (from #29039).
+This is run on release tags.
-https://github.com/pypa/gh-action-pypi-publish
+When the secret `SAGEMATH_PYPI_API_TOKEN` exists and the sdists were successfully created, it then proceeds to publish the sdists to PyPI using https://github.com/pypa/gh-action-pypi-publish
-This can be added to the `sdist.yml` workflow from #32403.
+At the moment, the secret `SAGEMATH_PYPI_API_TOKEN` is only available in the repository https://github.com/mkoeppe/sage; in response to a release tag pushed to it, the workflow has successfully built the 9.5.beta6 release sdists (+ this branch): https://github.com/mkoeppe/sage/runs/4200645206?check_suite_focus=true and deployed to PyPI (see, for example https://pypi.org/project/sagemath-standard/9.5b6/)
-We may want to add a safety check that avoids pushing a release that hasn't had a release candidate.
+Later we can move the deployment to https://github.com/sagemath/sage, simply by providing a secret `SAGEMATH_PYPI_API_TOKEN` to it. (We may want to add a safety check to the workflow that avoids pushing a release that hasn't had a release candidate.)
+Let's get this in please
Reviewer: Dima Pasechnik
OK, make pypi-sdists does seem to work.
Thanks!
Changed branch from u/mkoeppe/gh_actions__deploy_sdists_to_pypi to cd51972
Update: I have added the secret SAGEMATH_PYPI_API_TOKEN to https://github.com/sagemath/sage; using it, the GH Actions workflow running there has just uploaded source distributions to PyPI (https://github.com/sagemath/sage/runs/4769340060):
https://pypi.org/project/sage-setup/9.5rc0/
https://pypi.org/project/sage-conf/9.5rc0/
https://pypi.org/project/sage-sws2rst/9.5rc0/