Skip to content

Commit 4b52587

Browse files
authored
Add new workflow for deployment (#219)
1 parent 530b75b commit 4b52587

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

.github/workflows/python-publish.yml

+29-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: Upload Python Package
52

63
on:
74
release:
85
types: [created]
9-
6+
workflow_dispatch:
107
jobs:
11-
deploy:
12-
8+
build-n-publish:
9+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1310
runs-on: ubuntu-latest
14-
1511
steps:
16-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1713
- name: Set up Python
18-
uses: actions/setup-python@v2
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.x"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: >-
25+
python3 -m
26+
build
27+
--sdist
28+
--wheel
29+
--outdir dist/
30+
.
31+
- name: Publish distribution 📦 to Test PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
password: ${{ secrets.SANIC_TEST_PYPI_API_TOKEN }}
35+
repository-url: https://test.pypi.org/legacy/
36+
- name: Publish distribution 📦 to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
1938
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
39+
password: ${{ secrets.SANIC_PYPI_API_TOKEN }}

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = sanic-ext
3-
version = 23.3.0
3+
version = 23.6.0
44
url = http://github.com/sanic-org/sanic-ext/
55
license = MIT
66
author = Sanic Community

0 commit comments

Comments
 (0)