From 9fc7020a535b2ae71c37d067a4f822d39e19aa4f Mon Sep 17 00:00:00 2001 From: "Sara A. Miskovich" Date: Mon, 19 Aug 2024 13:53:46 -0700 Subject: [PATCH] fix build error, link to docs requ --- .github/workflows/build.yml | 13 ++++ .github/workflows/test-build.yml | 124 +++++++++++++++---------------- .readthedocs.yaml | 2 +- 3 files changed, 76 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 699be9e8..d1f13a9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,3 +78,16 @@ jobs: id: condaload run: | anaconda upload -u slacgismo /usr/share/miniconda3/conda-bld/noarch/solar-data-tools-${{ steps.condabuild.outputs.gitversion }}-*.tar.bz2 + + deploy-rtd: + runs-on: ubuntu-latest + needs: [build-pypi, build-conda] + environment: deployment + steps: + # Do not need to build and upload artifacts, just re-trigger to update tags/version on website + - name: Trigger RTDs build + uses: dfm/rtds-action@v1 + with: + webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} + webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} + commit_ref: ${{ github.ref }} diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index f1f9adb9..419315e0 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -6,71 +6,71 @@ on: push: branches: [dev] jobs: -# build-pypi: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v4 -# -# - uses: actions/setup-python@v4 -# 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 -# -# build-conda: -# runs-on: ubuntu-latest -# # sets default shell to remove need for source to run the conda shell -# defaults: -# run: -# shell: bash -l {0} -# environment: test-deployment -# steps: -# - name: Checkout Repository -# uses: actions/checkout@v3 -# -# - uses: actions/setup-python@v4 -# with: -# python-version: "3.10" -# -# # Much better than manual installation, original version Miniconda2-4.7.10-Linux-x86_64.sh is broken -# - uses: conda-incubator/setup-miniconda@v3 -# 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 . -# -# # 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 -# # channels need to be specified on build and are saved in the package for installs -# - name: Build the Anaconda Package -# id: condabuild -# run: | -# conda install anaconda-client -# conda clean --all -# conda config --set anaconda_upload no --set solver libmamba -# VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)test conda build . -c mosek -c slacgismo -c conda-forge -c stanfordcvxgrp --numpy 2.0 -# echo "gitversion=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)" >> $GITHUB_OUTPUT + build-pypi: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + 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 + + build-conda: + runs-on: ubuntu-latest + # sets default shell to remove need for source to run the conda shell + defaults: + run: + shell: bash -l {0} + environment: test-deployment + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + + # Much better than manual installation, original version Miniconda2-4.7.10-Linux-x86_64.sh is broken + - uses: conda-incubator/setup-miniconda@v3 + 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 . + + # 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 + # channels need to be specified on build and are saved in the package for installs + - name: Build the Anaconda Package + id: condabuild + run: | + conda install anaconda-client + conda clean --all + conda config --set anaconda_upload no --set solver libmamba + VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)test conda build . -c mosek -c slacgismo -c conda-forge -c stanfordcvxgrp --numpy 2.0 + echo "gitversion=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)" >> $GITHUB_OUTPUT deploy-rtd: runs-on: ubuntu-latest - #needs: [build-pypi, build-conda] + needs: [build-pypi, build-conda] environment: test-deployment steps: # Do not need to build and upload artifacts, just re-trigger to update tags/version on website diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b0a73ba2..631c373e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -19,7 +19,7 @@ sphinx: # Then, install special pinning for RTD. python: install: - - requirements: requirements.txt + - requirements: docs/requirements.txt - method: pip path: .