-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.56 KB
/
cd.yaml
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
name: Continuous Deployment
on:
workflow_dispatch:
# on:
# workflow_run:
# workflows:
# - Continuous Integration
# types:
# - completed
jobs:
release_new_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # Set the Python version you need
# - name: Install make
# run: |
# sudo apt-get update
# sudo apt-get install -y make
- 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
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 }}"