From 20f3ae1c23bf0decefb691f475a9506bd7ba47d8 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 21 Dec 2023 11:54:04 +0000 Subject: [PATCH] use pypa/gh-action-pypi-publish for release (#72) --- .github/workflows/ci.yml | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65cc622..6a30597 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set up python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: @@ -196,7 +196,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: get dist artifacts uses: actions/download-artifact@v3 @@ -224,30 +224,23 @@ jobs: - run: twine check dist/* release: - needs: [build, check] + needs: [check, build, inspect-pypi-assets] if: "success() && startsWith(github.ref, 'refs/tags/')" runs-on: ubuntu-latest + environment: release - steps: - - uses: actions/checkout@v3 + permissions: + id-token: write - - name: set up python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - run: pip install -U twine + steps: + - uses: actions/checkout@v4 - - name: get dist artifacts - uses: actions/download-artifact@v3 - with: - name: pypi_files - path: dist + - name: get dist artifacts + uses: actions/download-artifact@v3 + with: + name: pypi_files + path: dist - - run: twine check dist/* + - run: ls -lh dist - - name: upload to pypi - run: twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.pypi_token }} + - uses: pypa/gh-action-pypi-publish@release/v1