v0.3.2 #15
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 | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Twine and Build | |
run: sudo pip install twine build | |
- name: Create the distribution | |
run: | | |
git fetch --prune --unshallow --tags | |
sudo python3 -m build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
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@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- 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 -n base conda-libmamba-solver | |
conda install python=3.10 conda-build colorama pip ruamel ruamel.yaml rich jsonschema -c conda-forge | |
git fetch --prune --unshallow --tags | |
pip install -e . | |
# run install twice due to client-size to ensure all files downloaded | |
# 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 --set solver libmamba | |
echo yes | anaconda login --username ${{ secrets.ANACONDA_CLOUD_USERNAME }} --password ${{ secrets.ANACONDA_CLOUD_PASSWORD }} | |
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c anaconda -c conda-forge -c stanfordcvxgrp | |
echo "gitversion=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)" >> $GITHUB_OUTPUT | |
- name: Upload the Anaconda Package | |
id: condaload | |
run: | | |
anaconda upload -u stanfordcvxgrp /usr/share/miniconda3/conda-bld/noarch/sig-decomp-${{ steps.condabuild.outputs.gitversion }}-*.tar.bz2 |