diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6bbf861 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +on: + release: + types: [published] # releases and pre-releases (release candidates) + +jobs: + publish-pypi: + runs-on: ubuntu-latest + + # https://docs.pypi.org/trusted-publishers/using-a-publisher/ + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + + steps: + - uses: actions/checkout@v4 + + - name: Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine build + + - name: Build + run: python -m build + + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/main.yaml b/.github/workflows/test.yaml similarity index 96% rename from .github/workflows/main.yaml rename to .github/workflows/test.yaml index 18238a5..f233e62 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/test.yaml @@ -1,8 +1,5 @@ -name: unitary - on: - pull_request: - push: # all + push: jobs: unitary: