Skip to content

Commit

Permalink
update deployment and add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
havogt committed Jan 24, 2024
1 parent 11f9c1c commit f406928
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
workflow_dispatch:

jobs:
build-n-publish:
name: Build and publish Python distribution
build:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -21,14 +21,29 @@ jobs:
- name: Build a wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution to Test PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
publish-pypi:
name: Publish Python distribution to test.pypi.org
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'workflow_dispatch' }}
environment:
name: pypi
url: https://pypi.org/project/gt4py
permissions:
id-token: write
steps:
- name: Publish distribution to PyPI
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
publish-test-pypi:
name: Publish Python distribution to test.pypi.org
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'release' }}
environment:
name: testpypi
url: https://test.pypi.org/project/gt4py/
permissions:
id-token: write
steps:
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
8 changes: 6 additions & 2 deletions docs/development/tools/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ Currently, GT4Py releases are published in PyPI (and TestPyPI) and also as commi

5. On the GitHub website go to _Releases_ and _Draft a new release_. Choose `v0.{M}.{m}.{p}` as tag and select a branch (usually `main`). Follow the style of the previous releases for the title (`GT4Py v0.{M}.{m}.{p}`) and description. Then _Publish release_.

6. Upload distribution package to TestPyPI and quickly test that it works properly.
6. Publishing the release will trigger a Github action to deploy to TestPyPI. Install the package from TestPyPi and do basic tests.

7. Upload distribution package to PyPI and quickly that test it works properly.
7. If tests are ok, manually trigger the deploy Github action selecting the release tag as target. This will publish the package to PyPI. Install the package and test if it works.

## PyPi and TestPyPi accounts

The account is called `gridtools`. Credentials can be found in the bitwarden of CSCS. For 2FA, the recovery keys are stored in bitwarden, too. In case a new developer should get access, the recovery keys can be used to setup the authentication app (for all developers who should have access).

<!-- Reference links -->

Expand Down

0 comments on commit f406928

Please sign in to comment.