diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml deleted file mode 100644 index a256862..0000000 --- a/.github/workflows/pypi.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish package distributions to PyPI - -on: [push] - -jobs: - pypi-publish: - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/sphinxnotes-snippet - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - run: pip install build twine - - run: ls && make dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - password: ${{ secrets.PYPI_TEST_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f45192..22b5a68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create Releases on Tags +name: Publish New Release on: push: @@ -6,7 +6,26 @@ on: - "*" jobs: - build: + pypi: + name: Publish package distributions to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/sphinxnotes-snippet + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - run: pip install build twine && make dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_TEST_API_TOKEN }} + + release: + name: Publish Github Release + needs: [pypi] runs-on: ubuntu-latest permissions: contents: write