Publish #16
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: Publish | |
on: | |
release: | |
types: [created] | |
permissions: | |
contents: read | |
id-token: write # Required for OIDC | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install Build Tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Update Version in setup.py and __init__.py | |
run: | | |
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | |
sed -i "s/version=.*/version='$VERSION',/" setup.py | |
sed -i "s/__version__ = .*/__version__ = '$VERSION'/" lazypredict/__init__.py | |
- name: Build Package | |
run: python -m build | |
- name: Publish to PyPI | |
if: github.event.release.prerelease == false | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: 'https://upload.pypi.org/legacy/' | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.12 | |
- name: Initialize Conda | |
run: source /usr/share/miniconda/bin/activate | |
- name: Install Conda Build Tool | |
run: conda install -y conda-build | |
- name: Build Conda Package | |
run: | | |
source /usr/share/miniconda/bin/activate | |
conda-build . | |
- name: publish-to-conda | |
uses: fcakyon/[email protected] | |
with: | |
anacondatoken: ${{ secrets.ANACONDA_TOKEN }} | |
platforms: 'win osx linux' |