Merge pull request #10 from Matter-and-Form/RC/8.20.14 #39
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: CD | |
on: | |
push: | |
branches: | |
- release | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Update submodules | |
run: git submodule update --init --recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Transpile Schema | |
run: | | |
python ./scripts/build_proto.py | |
- name: Build the package | |
run: python -m build | |
- name: Build Documentation | |
run: | | |
python3 ./scripts/build_doc.py | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
pip install twine | |
twine upload --verbose --repository pypi dist/* | |
- name: Extract version | |
id: extract_version | |
run: | | |
CURRENT_VERSION=$(grep -oP "(?<=__version__ = ')[^']*" ./three/__init__.py) | |
echo "TAG=$CURRENT_VERSION" >> $GITHUB_ENV | |
- name: Create Release | |
run: | | |
gh release create ${{ env.TAG }} \ | |
--generate-notes \ | |
--title "${{ env.TAG }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |