v0.7.2 #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |