-
Notifications
You must be signed in to change notification settings - Fork 23
37 lines (32 loc) · 1.01 KB
/
release_package.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
name: Publish to PyPI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Check if Python package already exists
run: |
pip install PolyPhyPy==$(cat pyproject.toml | head -3 | tail -1 | cut -d '"' -f 2) && echo "true" > ./flag || echo "false" > ./flag
- name: Build and publish package
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
if grep -qF false ./flag; then
python3 -m pip install --upgrade build
python3 -m build
python3 -m pip install --upgrade twine
python3 -m twine upload dist/*
echo "New version is live!!!"
else
echo "Not publishing as the above version already exists!"
fi