-
Notifications
You must be signed in to change notification settings - Fork 78
42 lines (33 loc) · 963 Bytes
/
release.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
40
41
42
name: Release
on:
push:
branches: [ main ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upgrade setuptools/build
run: |
pip3 install wheel --upgrade
pip3 install setuptools --upgrade
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Check Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- name: Release to pypi
if: steps.check-tag.outputs.match == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_MAIN_TOKEN }}
run: |
python -m pip install --upgrade build
python -m build .
python -m pip install --upgrade twine
twine upload dist/*