Build and Publish #68
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: Build and Publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
build_pyquibbler: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./pyquibbler | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install setuptools wheel twine | |
- name: Build wheel | |
run: python -m pip wheel . -w ./dist --no-deps | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pyquibbler | |
path: ./pyquibbler/dist/*.whl | |
build_extension: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./pyquibbler-labextension | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install jupyterlab==3.1 wheel | |
- name: Build the extension | |
run: | | |
set -eux | |
npm install | |
python -m pip install . | |
jupyter labextension list 2>&1 | grep -ie "pyquibbler-labextension.*OK" | |
python -m jupyterlab.browser_check | |
python -m pip wheel . -w ./dist --no-deps | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pyquibbler_labextension | |
path: ./pyquibbler-labextension/dist/*.whl | |
publish: | |
needs: [build_pyquibbler, build_extension] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: . | |
- name: Copy to dist | |
run: | | |
mkdir dist | |
cp -r pyquibbler/* dist/ | |
cp -r pyquibbler_labextension/* dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |