Skip to content

Merge branch 'develop' of github.com:Matter-and-Form/three-python-lib… #42

Merge branch 'develop' of github.com:Matter-and-Form/three-python-lib…

Merge branch 'develop' of github.com:Matter-and-Form/three-python-lib… #42

Workflow file for this run

name: CI
on:
push:
branches:
- develop
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: Increment Version
run: |
./scripts/incrementVersion.sh
- 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: Publish to TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
pip install twine
twine upload --verbose --repository testpypi dist/*
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@matterandform.net'
git add .
git commit -m "CI: Version bump and transpiled code [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version number
id: extract_version
run: |
CURRENT_VERSION=$(grep -oP "(?<=__version__ = ')[^']*" ./three/__init__.py)
echo "VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
# Create a pull request for master
- name: Create Pull Request
run: |
echo "Switching to branch..."
git switch -c RC/${{ env.VERSION }}
git push --set-upstream origin RC/${{ env.VERSION }}
echo "Creating a pull request..."
TITLE="Release Candidate for three-python-library - ${{ env.VERSION }}"
BODY="Generated automatically by Github Actions Bot.
Version - ${{ env.VERSION }}"
gh pr create --title "$TITLE" --body "$BODY" --base release --head RC/${{ env.VERSION }} --label "rc"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}