packages #190
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: 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 14 * * SUN' | |
env: | |
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable" | |
PYTHON_VERSION: "3.10" | |
jobs: | |
conda_build: | |
name: Build Conda Package | |
runs-on: 'ubuntu-latest' | |
defaults: | |
run: | |
shell: bash -el {0} | |
outputs: | |
conda_file: ${{ env.CONDA_FILE }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
fetch-tags: true | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
- name: conda setup | |
run: | | |
# pyct is for running setup.py | |
conda install -y conda-build build pyct -c pyviz/label/dev | |
- name: conda build | |
run: | | |
source ./scripts/build_conda.sh | |
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/holoviews-$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 | |
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/') | |
env: | |
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Set environment variables | |
run: | | |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
echo "CONDA_FILE=${{ needs.conda_build.outputs.conda_file }}" >> $GITHUB_ENV | |
- name: Check environment variables | |
run: | | |
echo $TAG $CONDA_FILE | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
- name: conda setup | |
run: | | |
conda install -y anaconda-client | |
- uses: actions/download-artifact@v3 | |
with: | |
name: conda_build | |
path: ${{ env.CONDA_FILE }} | |
- name: conda dev upload | |
if: contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc') | |
run: | | |
# anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev ${{ env.CONDA_FILE }} | |
echo "conda dev upload" | |
- name: conda main upload | |
if: (!(contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc'))) | |
run: | | |
# anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev --label=main ${{ env.CONDA_FILE }} | |
echo conda main upload | |
pip_build: | |
name: Build PyPI Package | |
runs-on: 'ubuntu-latest' | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
fetch-tags: true | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install build | |
run: | | |
python -m pip install build | |
- name: Build package | |
run: python -m build . | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: pip_build | |
path: dist/ | |
if-no-files-found: error | |
pip_publish: | |
name: Publish PyPI Package | |
runs-on: ubuntu-latest | |
needs: [pip_build, waiting_room] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pip_build | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.PPU }} | |
password: ${{ secrets.PPP }} | |
repository-url: "https://upload.pypi.org/legacy/" | |
waiting_room: | |
name: Waiting Room | |
runs-on: ubuntu-latest | |
needs: [conda_build, pip_build] | |
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" |