sagemath/sage

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-publish

Changed dependencies from #29039 to #29039, #32403

Description 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:

aeca1a0Makefile (pypi-sdists): Add sage_setup
cd3dce9pkgs/sage-conf_pypi/setup.py: Update directory of configured sage_conf.py
c695921pkgs/sage-conf/sage_conf.py.in (SAGE_SPKG_WHEELS): Update so it works if SAGE_VENV != SAGE_LOCAL
cebcda3Merge tag '9.5.beta4' into t/29039/pip_installable_package_sage_bootstrap
0026892Merge tag '9.5.beta5' into t/29039/pip_installable_package_sage_bootstrap
a16df32Merge #29039
1261494.github/workflows/sdist.yml (deploy_sdists_pypi): New
a21cb3cMakefile (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.)
+

Commit: 899d8cb

Branch pushed to git repo; I updated commit sha1. New commits:

2a4a323Merge tag '9.5.beta7' into t/29039/pip_installable_package_sage_bootstrap
cd51972Merge #29039

Changed commit from 899d8cb to cd51972

comment:8

Let's get this in please

Reviewer: Dima Pasechnik

comment:9

OK, make pypi-sdists does seem to work.

comment:10

Thanks!

Changed commit from cd51972 to none