packages #153
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 13 * * 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" | |
PKG_TEST_PYTHON: "--test-python=py37" | |
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: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
- name: Set output | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: conda setup | |
run: | | |
conda update --name base conda | |
conda install anaconda-client conda-build | |
pip install hatch | |
- name: conda build | |
run: | | |
VERSION=`hatch version` conda build conda.recipe/ | |
- 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: | | |
anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev $(VERSION=`hatch version` conda build --output conda.recipe) | |
- 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: | | |
anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev --label=main $(VERSION=`hatch version` conda build --output conda.recipe) | |
pip_build: | |
name: Build PyPI Packages | |
runs-on: 'ubuntu-latest' | |
defaults: | |
run: | |
shell: bash -l {0} | |
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: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
- name: pip build | |
run: | | |
python -m build | |
- 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/ |