packages #567
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: packages | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | |
# Dry-run only | |
workflow_dispatch: | |
schedule: | |
- cron: '0 19 * * SUN' | |
env: | |
PYTHON_VERSION: "3.9" | |
NODE_VERSION: "18" | |
MPLBACKEND: "Agg" | |
jobs: | |
conda_build: | |
name: Build Conda Package | |
runs-on: 'ubuntu-latest' | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: remove nodejs | |
run: | | |
sudo rm /usr/local/bin/node | |
sudo rm /usr/local/bin/npm | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: conda setup | |
run: | | |
conda config --set always_yes True | |
conda config --append channels pyviz/label/dev | |
conda config --append channels bokeh/label/dev | |
conda install -y conda-build anaconda-client build | |
- name: conda build | |
run: | | |
source ./scripts/build_conda.sh | |
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/panel-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda_build | |
path: ${{ env.CONDA_FILE }} | |
if-no-files-found: error | |
- name: conda dev deploy | |
if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) | |
run: | | |
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev $CONDA_FILE | |
- name: conda main deploy | |
if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) | |
run: | | |
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev --label=main $CONDA_FILE | |
npm_build: | |
name: Build NPM Package | |
runs-on: 'ubuntu-latest' | |
needs: [conda_build, pip_build] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: remove nodejs | |
run: | | |
sudo rm /usr/local/bin/node | |
sudo rm /usr/local/bin/npm | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: npm setup | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_API_TOKEN }}" > $HOME/.npmrc | |
npm whoami | |
npm -v | |
- name: npm build | |
run: | | |
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m pip install -ve . | |
cd ./panel | |
TARBALL=$(npm pack .) | |
echo "TARBALL=$TARBALL" >> $GITHUB_ENV | |
npm publish --dry-run $TARBALL | |
cd .. | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: npm_build | |
path: ./panel/${{ env.TARBALL }} | |
if-no-files-found: error | |
- name: npm dev deploy | |
if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) | |
run: | | |
cd ./panel | |
npm publish --tag dev $TARBALL | |
cd .. | |
- name: npm main deploy | |
if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc'))) | |
run: | | |
cd ./panel | |
npm publish --tag latest $TARBALL | |
cd .. | |
cdn: | |
name: Build CDN | |
runs-on: 'ubuntu-latest' | |
needs: [conda_build, pip_build] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: remove nodejs | |
run: | | |
sudo rm /usr/local/bin/node | |
sudo rm /usr/local/bin/npm | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: build pyodide wheels for CDN | |
run: | | |
python ./scripts/build_pyodide_wheels.py | |
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m pip install -ve . | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: cdn_wheels | |
path: | | |
./build/panel*.whl | |
./build/bokeh*.whl | |
if-no-files-found: error | |
- name: Deploy to cdn.holoviz.org | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: 'us-east-1' | |
run: python scripts/cdn_upload.py | |
pip_build: | |
name: Build PyPI Package | |
runs-on: 'ubuntu-latest' | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
CHANS_DEV: "-c pyviz/label/dev -c bokeh/label/dev -c conda-forge" | |
PKG_TEST_PYTHON: "--test-python=py39" | |
CHANS: "-c pyviz" | |
PYPI: "https://upload.pypi.org/legacy/" | |
steps: | |
- name: remove nodejs | |
run: | | |
sudo rm /usr/local/bin/node | |
sudo rm /usr/local/bin/npm | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- name: conda setup | |
run: | | |
conda config --set always_yes True | |
conda install -c pyviz "pyctdev>=0.5" | |
doit ecosystem_setup | |
doit env_create $CHANS_DEV --python=$PYTHON_VERSION | |
- name: env setup | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate test-environment | |
conda install ${{ env.CHANS_DEV }} "pip<21.2.1" | |
doit develop_install $CHANS_DEV -o build | |
pip uninstall -y panel | |
doit pip_on_conda | |
- name: pip build | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate test-environment | |
doit ecosystem=pip package_build $PKG_TEST_PYTHON --test-group=flakes | |
- name: git status | |
run: | | |
git status | |
git diff | |
- name: pip upload | |
if: github.event_name == 'push' | |
run: | | |
eval "$(conda shell.bash hook)" | |
conda activate test-environment | |
doit ecosystem=pip package_upload -u ${{ secrets.PPU }} -p ${{ secrets.PPP }} -r $PYPI |