diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..94ae99b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish to PyPI +on: workflow_dispatch +permissions: + contents: read +concurrency: pypi-publish + +jobs: + publish: + runs-on: ubuntu-24.04 + environment: pypi + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.11' + - run: python -m pip install build twine + - name: Build and check distributions + run: | + python -m build + python -m twine check --strict dist/* + - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 diff --git a/.github/workflows/testpypi.yml b/.github/workflows/testpypi.yml deleted file mode 100644 index 767afff..0000000 --- a/.github/workflows/testpypi.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Publish to TestPyPI - -# Configure a TestPyPI Trusted Publisher for hsluv/hsluv-python, testpypi.yml, -# environment testpypi. Run from main with a version not already on TestPyPI. -on: - workflow_dispatch: - -permissions: - contents: read - id-token: write - -jobs: - publish: - if: github.repository == 'hsluv/hsluv-python' && github.ref == 'refs/heads/main' - runs-on: ubuntu-24.04 - environment: testpypi - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - with: - persist-credentials: false - - - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 - with: - python-version: '3.11' - - - run: python -m pip install build - - run: python -m build - - - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 - with: - repository-url: https://test.pypi.org/legacy/