-
Notifications
You must be signed in to change notification settings - Fork 28
56 lines (51 loc) · 1.82 KB
/
release.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
name: Release
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python - --version 1.3.2
poetry install --with dev,docs --all-extras
echo "PYTHONPATH=`pwd`" >> $GITHUB_ENV
- name: Autobump version
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
VERSION_PLACEHOLDER='__version__ = "0.0.0"'
VERSION_FILE='platipy/__init__.py'
grep "$VERSION_PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$VERSION_PLACEHOLDER/__version__ = \"${VERSION}\"/g" 'platipy/__init__.py'
PYPROJECT_PLACEHOLDER='version = "0.0.0"'
PYPROJECT_FILE='pyproject.toml'
grep "$PYPROJECT_PLACEHOLDER" "$PYPROJECT_FILE"
sed -i "s/$PYPROJECT_PLACEHOLDER/version = \"${VERSION}\"/g" "$PYPROJECT_FILE"
shell: bash
- name: Build & publish package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry build
poetry publish
- name: Build docs
run: |
sudo apt-get update -y && sudo apt-get install -y pandoc
poetry run sphinx-build -b html -a docs docs/site
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site
- name: Build docker
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: pyplati/platipy
event-type: docker