summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Socol <me@jamessocol.com>2022-12-04 11:47:45 -0500
committerJames Socol <me@jamessocol.com>2022-12-04 11:48:39 -0500
commit47d6cf824c6f37294a34563c94c26010c5ccee8d (patch)
tree7c72b5bfdda786c121f334ae70e3048a35367077
parent835faceba145eed559d002448e090142cbd0264a (diff)
downloadpystatsd-47d6cf824c6f37294a34563c94c26010c5ccee8d.tar.gz
Add a release workflow
Borrowing from the work I did yesterday for django-ratelimit, this should provide automated PyPI build and publish. Fixes #180
-rw-r--r--.github/workflows/release.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..ab82ace
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,49 @@
+name: release
+
+on:
+ push:
+ tags:
+ - v*
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: true
+ matrix:
+ python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: ./.github/actions/test
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ release:
+ runs-on: ubuntu-latest
+ needs: [test]
+ steps:
+
+ - uses: actions/checkout@v3
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.11
+
+ - name: install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install build twine
+
+ - name: build
+ run: ./run.sh build
+
+ - name: check
+ run: ./run.sh check
+
+ - name: release
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ password: ${{ secrets.PYPI_DEPLOY_TOKEN }}