-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.85 KB
/
deploy.yml
File metadata and controls
64 lines (51 loc) · 1.85 KB
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
name: deploy
on:
pull_request:
types:
- closed
branches:
- master
env:
POETRY_VERSION: 1.1.13
PYTHON_VERSION: 3.7.1
jobs:
deploy:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-v')
runs-on: ubuntu-18.04
name: Deploy the basic_iter package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
steps:
- uses: actions/checkout@v3
- name: Validate the tag and the repository configurations
run: |
set -x
BRANCH=${GITHUB_HEAD_REF##*/}
PYPROJECT=release-v$(sed -n -e "s/^version = \"\(.*\)\"/\1/p" pyproject.toml)
DOC=release-v$(sed -n -e "s/^release = '\(.*\)'/\1/p" ./docs/source/conf.py)
[ "${BRANCH}" = "${PYPROJECT}" -a "${PYPROJECT}" = "${DOC}" ] || exit 1
- name: Set default python version to 3
run: |
sudo update-alternatives --remove python /usr/bin/python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
- name: Supress needless warning from pip
run: |
mkdir -p $HOME/.config/pip
echo '[global]' > $HOME/.config/pip/pip.conf
echo 'disable-pip-version-check = True' >> $HOME/.config/pip/pip.conf
- name: Install poetry
run: |
sudo apt-get install python3-setuptools
pip install --upgrade pip
pip install wheel
pip install poetry==${POETRY_VERSION}
- uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'poetry'
- name: Set the python version with poetry
run: poetry env use ${PYTHON_VERSION}
- name: Build the basic_iter package
run: poetry build
- name: Deploy the basic_iter package
run: poetry publish