-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (58 loc) · 1.79 KB
/
pipeline.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Deployment Pipeline
on:
workflow_dispatch:
jobs:
integration:
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.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Test BioCompose
run: |
pytest tests/main.py
deployment:
runs-on: ubuntu-latest
needs: integration
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
source $GITHUB_ENV
- name: Install dependencies
run: |
poetry install
- name: Extract project version
run: |
VERSION=$(poetry run python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
echo "VERSION=$VERSION" >> $GITHUB_ENV
# - name: Build Documentation
# run: |
# make -C documentation clean
# make -C documentation html
# - name: Create new github tags
# run: |
# git tag -m "Version v${{ env.VERSION }}" "v${{ env.VERSION }}"
# git push --tags
- name: Publish new version on PyPI
run: |
poetry build
sudo rm -rf bio_compose/__pycache__
sudo rm -rf tests/__pycache__
poetry publish --username __token__ --password ${{ secrets.ADMIN_PYPI_TOKEN }}
- name: Notify Deployment
run: echo "Version ${{ env.VERSION }} as been published on PyPI with release ${{ github.ref }}"