From 86c848afcdc58a5078e414f7c96aaf8221011586 Mon Sep 17 00:00:00 2001 From: Michael O'Brien <24856964+mjo22@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:59:07 -0400 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 46 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0cb58fea..fbfede44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,39 +6,31 @@ on: workflow_dispatch: jobs: - build: + deploy: + name: Deploy runs-on: ubuntu-latest + + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing on PyPi + # see https://docs.pypi.org/trusted-publishers/ + id-token: write + # This permission allows writing releases + contents: write + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v5 - name: Install Python + + - name: 🐍 Set up Python + uses: actions/setup-python@v5 with: python-version: "3.10" - - name: Install dependencies + + - name: 👷 Build run: | - python -m pip install -U pip - python -m pip install -U pkginfo build twine - - name: Build the distribution - run: python -m build . - - name: Check the distribution - run: python -m twine check --strict dist/* - - uses: actions/upload-artifact@v4 - with: - path: dist/* + python -m pip install build + python -m build - publish: - environment: - name: pypi - url: https://pypi.org/p/cryojax - permissions: - id-token: write - needs: [build] - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4 - with: - name: artifact - path: dist - - uses: pypa/gh-action-pypi-publish@v1.8.12 + - name: 🚢 Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1