Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install "anaconda-client>=1.7.2" conda-build
- name: Extract version from tag
id: get_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "Version extracted: $VERSION"
- name: Build and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
set -e
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build and publish to Conda
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: |
set -e
conda config --set anaconda_upload no
conda build conda/meta.yaml -c conda-forge -c colomoto -c defaults --output-folder output
anaconda upload output/noarch/*.tar.bz2 --user your-username