-
Notifications
You must be signed in to change notification settings - Fork 11
53 lines (43 loc) · 1.24 KB
/
deploy.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
43
44
45
46
47
48
49
50
51
52
53
name: Deploy
on:
push:
tags:
- 'v*.*.*'
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: |
echo ::set-output name=version::$(cat 123tv_iptv.py \
| grep "^VERSION = '\([0-9.]\+\)'" | grep -o "[0-9.]\+")
shell: bash
- name: Get the tag
id: get_tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
shell: bash
- name: Version check
if: ${{ format('v{0}', steps.get_version.outputs.version) != steps.get_tag.outputs.tag }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('tag and version are not equivalent!')
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools twine
python -m pip install -e .[dev]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*