Skip to content

packages

packages #246

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:
inputs:
target:
description: Build target
type: choice
options:
- dryrun
required: true
default: dryrun
schedule:
- cron: '0 20 * * SUN'
jobs:
conda_build:
name: Build Conda Packages
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash -l {0}
env:
CHANS_DEV: "-c pyviz/label/dev -c conda-forge"
PKG_TEST_PYTHON: "--test-python=py39"
PYTHON_VERSION: "3.9"
CHANS: "-c pyviz"
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
python-version: "3.9"
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: conda setup
run: |
conda config --set always_yes True
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem=conda ecosystem_setup
conda install -c conda-forge conda-build param
- name: conda build
run: |
conda build conda.recipe/ -c pyviz/label/dev -c conda-forge
- name: conda dev upload
if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
run: |
doit ecosystem=conda package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev --label tooling_dev
- name: conda main upload
if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
run: |
doit ecosystem=conda package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev --label=main --label tooling_dev
pip_build:
name: Build PyPI Packages
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash -l {0}
env:
PKG_TEST_PYTHON: "--test-python=py39"
steps:
- uses: actions/checkout@v4
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: env setup
run: |
pip install pyctdev
doit ecosystem_setup
- name: pip build
run: |
doit package_build $PKG_TEST_PYTHON --test-group=installed --sdist-install-build-deps
- name: Publish package to PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PPU }}
password: ${{ secrets.PPP }}
packages_dir: dist/