Skip to content

Merge pull request #85 from unum-cloud/main-dev #11

Merge pull request #85 from unum-cloud/main-dev

Merge pull request #85 from unum-cloud/main-dev #11

Workflow file for this run

name: Release
on:
push:
branches: ["main"]
env:
BUILD_TYPE: Release
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
PYTHONUTF8: 1
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
versioning:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
- run: cp .github/workflows/package.json . && npm install && npx semantic-release
rebase:
name: Rebase Dev. Branch
needs: versioning
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Perform rebase
run: |
git fetch origin main
git checkout main-dev
git rebase origin/main
- name: Push changes
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
branch: main-dev
unprotect_reviews: True
force: True
build_wheels:
name: Build Wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: versioning
strategy:
matrix:
os: [ubuntu-20.04, macOS-11, windows-2022]
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
- uses: actions/setup-python@v3
- name: Setup Docker
if: matrix.os != 'windows-2022'
uses: crazy-max/ghaction-setup-docker@v1
env:
SIGN_QEMU_BINARY: 1
- name: Setup QEMU
if: matrix.os != 'windows-2022'
uses: docker/[email protected]
- name: Install CIBuildWheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish_python:
name: Publish Python
runs-on: ubuntu-20.04
needs: build_wheels
environment:
name: pypi
url: https://pypi.org/p/ucall
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/[email protected]
with:
path: ./dist/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: ./dist/artifact
verbose: true
print_hash: true
deploy_docs:
name: Deploy Docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
if: ${{ always() }}
needs: publish_python
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'main'
- name: Setup GitHub Pages
uses: actions/configure-pages@v2
- name: Install dependencies
run: sudo apt update && sudo apt install -y doxygen graphviz dia git && pip install sphinx breathe furo m2r2 sphinxcontrib-googleanalytics==0.2.dev20220708 sphinxcontrib-jquery
- name: Install UCall from PyPi
run: pip install ucall
- name: Build documentation
run: cd docs && doxygen conf.dox && make html
- name: Copy assets
run: cp -r assets build/docs/html/
- name: Upload artifacts
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "./build/docs/html/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1