summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2024-05-04 20:22:24 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2024-05-27 20:50:30 +0200
commit24370c34871148d7af7335964bbdaf7330475968 (patch)
treea6a40c59450ace112f232992ae5109915c0e9f87
parentd545f209c6258406376fce4b058f6183e161fb90 (diff)
CI: Add "trusted publishing" workflow
-rw-r--r--.github/workflows/publish.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..1312b44
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,45 @@
+name: Build and publish to PyPI
+on: push
+jobs:
+ build:
+ name: Build distribution
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: true
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3"
+ - name: Install "build"
+ run: |
+ python -m pip install build
+ - name: Build binary wheels and a source tarball
+ run: ./make_dist.sh
+ - name: Store the distribution packages
+ uses: actions/upload-artifact@v4
+ with:
+ name: dist
+ path: dist
+ publish:
+ name: Upload release to PyPI
+ if: startsWith(github.ref, 'refs/tags/')
+ needs:
+ - build
+ runs-on: ubuntu-latest
+ environment:
+ name: pypi
+ url: https://pypi.org/p/sounddevice
+ permissions:
+ id-token: write
+ steps:
+ - name: Get the artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: dist
+ path: dist
+ - name: Publish package distributions to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ print-hash: true