diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index 8072eb7..0000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [published] - -jobs: - build-n-publish: - name: Publish to PyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Initializes Python 3.9 - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools - - name: Build and Publish - run: python setup.py sdist - - name: Publish - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c22cf1a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release + +on: + release: + types: [published] + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/slurminade + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + # retrieve your distributions here + - uses: actions/checkout@master + - uses: actions/setup-python@v4 + - name: Build SDist and wheel + run: pipx run build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file