diff --git a/.github/workflows/cicd-publish.yml b/.github/workflows/cicd-publish.yml index 127a1d7..933873f 100644 --- a/.github/workflows/cicd-publish.yml +++ b/.github/workflows/cicd-publish.yml @@ -1,4 +1,31 @@ +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+.post[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+" + - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" + jobs: + build: + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install dependencies + run: pip install flit + - name: Create packages + run: flit build --setup-py + - name: Store package artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest @@ -8,7 +35,9 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - # retrieve your distributions here - - - name: Publish package distributions to PyPI + - name: Retrieve package artifacts + uses: actions/download-artifact@v4 + - name: Upload packages to PYPI uses: pypa/gh-action-pypi-publish@release/v1 + +