-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.3 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
name: Continuous Deployment
on:
workflow_dispatch:
jobs:
CD:
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'
- 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 Toml
run: |
poetry run pip install toml
- name: Extract project version
run: |
VERSION=$(poetry run python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
echo "VERSION=$VERSION" >> $GITHUB_ENV
# - 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 bsp/__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 }}"