diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e188ea37..5207e55c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,8 @@ jobs: run: | cd $GITHUB_WORKSPACE pytest - release: + + docs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" @@ -58,12 +59,33 @@ jobs: python -m pip install --upgrade pip python --version pip install -r requirements.txt - - name: Build - run: | - python -m build - name: Deploy docs + run: mkdocs gh-deploy --force + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: docs + environment: release + permissions: + id-token: write + steps: + - name: Checkout the commit + uses: actions/checkout@v3 + + - name: Set up Python 3.8 + uses: actions/setup-python@v3 + with: + python-version: "3.8" + + - name: Install dependencies run: | - mkdocs gh-deploy --force + cd $GITHUB_WORKSPACE + python -m pip install --upgrade pip + python --version + pip install -r requirements.txt + - name: Build + run: python -m build - name: Upload to pypi - run: | - twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/* + run: pypa/gh-action-pypi-publish@release/v1