Skip to content

Build and publish

Build and publish #589

Workflow file for this run

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"
# TEMP ONLY FOR THIS PR
pull_request:
branches:
- '*'
defaults:
run:
shell: bash -el {0}
env:
PACKAGE: "panel"
PYTHON_VERSION: "3.9"
NODE_VERSION: "18"
MPLBACKEND: "Agg"
jobs:
waiting_room:
name: Waiting Room
runs-on: ubuntu-latest
needs: [conda_build]
# needs: [conda_build, pip_install]
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# environment:
# name: publish
steps:
- run: echo "All builds have finished, have been approved, and ready to publish"
conda_build:
name: Build Conda Package
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: conda setup
run: |
conda install -y conda-build build -c pyviz/label/dev
- name: conda build
run: |
source ./scripts/build_conda.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
if: always()
with:
name: conda_build
path: ${{ env.CONDA_FILE }}
if-no-files-found: error
conda_publish:
name: Publish Conda Package
runs-on: ubuntu-latest
needs: [conda_build, waiting_room]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: conda_build
path: dist/
- name: Set environment variables
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "CONDA_FILE=$(ls dist/*.tar.bz2)" >> $GITHUB_ENV
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: conda setup
run: |
conda install -y anaconda-client
- name: conda dev upload
if: contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')
run: |
echo UNCOMMENT
# anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev $CONDA_FILE
- name: conda main upload
if: (!(contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')))
run: |
echo UNCOMMENT
# 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
# if-no-files-found: error
# path: ./panel/${{ env.TARBALL }}
# - 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 -m pip install packaging tomli
# python ./scripts/build_pyodide_wheels.py --verify-clean
# SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m pip install -ve .
# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: cdn_wheels
# if-no-files-found: error
# path: |
# ./panel/dist/wheels/panel*.whl
# ./panel/dist/wheels/bokeh*.whl
# - 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