0.1.6 #7
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: Deploy Main | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy-pypi: | |
runs-on: ubuntu-latest | |
environment: deployment | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Install Twine | |
run: sudo pip install twine | |
- name: Create the distribution | |
run: | | |
git fetch -f --prune --unshallow --tags | |
sudo python setup.py sdist bdist_wheel | |
- name: Push to PyPI | |
run: sudo twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/* | |
deploy-conda: | |
runs-on: ubuntu-latest | |
environment: deployment | |
# sets default shell to remove need for source to run the conda shell | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Install Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-activate-base: true | |
activate-environment: "" | |
miniconda-version: "latest" | |
- name: Install the Conda Dependencies | |
run: | | |
conda config --set always_yes yes --set auto_update_conda false | |
conda update conda | |
conda install conda-build | |
# echo yes before login to prevent anaconda bug breaking automation | |
# git tags MUST be fetched otherwise output will be blank | |
# bash variables cannot be used in github actions, must use actions specific syntax and methods | |
- name: Build the Anaconda Package | |
id: condabuild | |
run: | | |
conda install anaconda-client | |
conda config --set anaconda_upload no | |
echo yes | anaconda login --username ${{ secrets.ANACONDA_CLOUD_USERNAME }} --password ${{ secrets.ANACONDA_CLOUD_PASSWORD }} | |
git fetch -f --prune --unshallow --tags | |
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c pytorch -c stanfordcvxgrp -c conda-forge --numpy 1.22.2 | |
echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)' | |
- name: Upload the Anaconda Package | |
id: condaload | |
run: | | |
anaconda upload -u stanfordcvxgrp /usr/share/miniconda3/conda-bld/noarch/torch-linops-${{ steps.condabuild.outputs.gitversion }}-*.tar.bz2 |