From d2613c3ebefd38ccd451ba103b1fd0c1efa23e9a Mon Sep 17 00:00:00 2001 From: Ben Thompson Date: Tue, 2 Aug 2022 12:49:33 -0400 Subject: [PATCH 1/2] Update release instructions to use annotated tag. Added automated test of the published package. --- .github/workflows/test.yml | 9 +++++++++ release | 14 ++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29f57d6..0c29337 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,3 +83,12 @@ jobs: with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true + - name: Check published package + if: startsWith(github.ref, 'refs/tags') + run: | + mamba create -n testenv python=3 pip + conda activate testenv + pip install --force-reinstall --no-cache cppimport + pushd tests + python -c 'import cppimport; assert(cppimport.imp("mymodule").add(1,2) == 3);' + popd \ No newline at end of file diff --git a/release b/release index 2bd8f71..a6cdfb1 100644 --- a/release +++ b/release @@ -1,14 +1,12 @@ GIT: git commit -m "yy.mm.dd" -git tag yy.mm.dd +git tag -a 22.08.02 -m "22.08.02" git push --atomic origin main yy.mm.dd wait for github action to complete create release on github -SANITY TEST: -open new terminal -mamba create -n testenv python=3 pip -conda activate testenv -pip install --force-reinstall --no-cache cppimport -cd tests -python -c 'import cppimport; assert(cppimport.imp("mymodule").add(1,2) == 3);' +remaining tasks to automate in the publish CI workflow: +- publish to test pypi first +- then, check the published package +- then, republish to real pypi +- then, run the automatic release action. From bd547b16212c7b405a40cf930b56cbafd126a74d Mon Sep 17 00:00:00 2001 From: Ben Thompson Date: Tue, 2 Aug 2022 12:51:55 -0400 Subject: [PATCH 2/2] Move to release/v1 from master for pypa/gh-action-pypi-publish master is deprecated --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c29337..9d66ba8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,7 +79,7 @@ jobs: python setup.py sdist - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true @@ -91,4 +91,4 @@ jobs: pip install --force-reinstall --no-cache cppimport pushd tests python -c 'import cppimport; assert(cppimport.imp("mymodule").add(1,2) == 3);' - popd \ No newline at end of file + popd