Skip to content

Merge pull request #155 from spglib/numpy20 #85

Merge pull request #155 from spglib/numpy20

Merge pull request #155 from spglib/numpy20 #85

Workflow file for this run

name: deploy
on:
push:
branches: [main, rc]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
jobs:
deploy-docs:
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools_scm wheel
python -m pip install -e .[dev,docs]
- name: Build
run: |
sphinx-build docs docs_build
# Generated documents are push to `gh-pages` branch
# `ACTIONS_DEPLOY_KEY` is set by following: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-create-ssh-deploy-key
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs_build
deploy-pypi:
runs-on: ubuntu-latest
needs:
- deploy-docs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Build
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools_scm wheel
python setup.py sdist bdist_wheel
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true