diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3571023 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: publish + +on: + release: + types: [published] + +jobs: + build: + name: Build the source tarball and the wheel + 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 hatch + - name: Create packages + run: hatch build + - name: Archive packages + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + + publish: + name: Publish build artifacts to PyPI + needs: build + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Retrieve packages + uses: actions/download-artifact@v4 + - name: Upload packages + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 98% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index c673e8e..ced9aa4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: test on: push: diff --git a/README.md b/README.md index e570e16..a041277 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://github.com/davidbrochart/ypywidgets/workflows/CI/badge.svg)](https://github.com/davidbrochart/ypywidgets/actions) +[![Build Status](https://github.com/davidbrochart/ypywidgets/workflows/test/badge.svg)](https://github.com/davidbrochart/ypywidgets/actions) # ypywidgets: Y-based Jupyter widgets for Python