-
Notifications
You must be signed in to change notification settings - Fork 14
39 lines (32 loc) · 951 Bytes
/
deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deployment
# deploy package to pypi on condition of
# push to main branch
# and release published
on:
release:
types:
- published
jobs:
Publish-Package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Version the package
run: |
echo "__version__ = '${{ github.ref_name }}'" > chapa/__init__.py
export CHAPA_VERSION=${{ github.ref_name }}
- name: Install pypa/build
run: |
python -m pip install build
python -m pip install wheel twine setuptools
- name: Build a binary wheel and a source tarball
run: |
rm -rf dist/
python -m build
- name: Publish distribution 📦 to PyPI
run: python -m twine upload dist/* --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}