Skip to content

Commit

Permalink
Merge pull request #29 from rpanderson/setup-miniconda-action
Browse files Browse the repository at this point in the history
Setup miniconda action
  • Loading branch information
chrisjbillington authored Nov 19, 2021
2 parents f393067 + 4c93d81 commit ee69652
Showing 1 changed file with 24 additions and 41 deletions.
65 changes: 24 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

defaults:
run:
shell: bash
shell: bash -l {0}

env:
PACKAGE_NAME: workflow-sandbox
Expand Down Expand Up @@ -100,50 +100,35 @@ jobs:

- name: Set Variables for Conda Build
run: |
if [ $RUNNER_OS == Windows ] && [ ${{ matrix.arch }} == x64 ]; then
CONDA_INSTALLER=Miniconda3-latest-Windows-x86_64.exe
elif [ $RUNNER_OS == Windows ]; then
CONDA_INSTALLER=Miniconda3-latest-Windows-x86.exe
elif [ $RUNNER_OS == Linux ]; then
CONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh
else
CONDA_INSTALLER=Miniconda3-latest-MacOSX-x86_64.sh
fi
if [ $NOARCH == true ]; then
CONDA_BUILD_ARGS="--noarch"
else
CONDA_BUILD_ARGS=""
fi
echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
- name: Install Miniconda
# 2.0.1 until https://github.com/conda-incubator/setup-miniconda/pull/189 merged
# and released. Then can change to v2
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
miniconda-version: "latest"

- name: Conda package (Unix)
if: runner.os != 'Windows'
run: |
curl -LO https://repo.continuum.io/miniconda/$CONDA_INSTALLER
bash "$CONDA_INSTALLER" -b -p .miniconda
source .miniconda/etc/profile.d/conda.sh
conda activate
conda update -n base -c defaults conda
conda create -n py${{ matrix.python }} python=${{ matrix.python }}
conda activate py${{ matrix.python }}
conda install -c cbillington setuptools-conda
pip install --upgrade setuptools_scm
conda install -c labscript-suite setuptools-conda
setuptools-conda build $CONDA_BUILD_ARGS .
- name: Conda Package (Windows)
if: runner.os == 'Windows'
shell: cmd
shell: cmd /C CALL {0}
run: |
curl -LO https://repo.continuum.io/miniconda/%CONDA_INSTALLER%
%CONDA_INSTALLER% /S /D=%CD%\.miniconda && ^
.miniconda\Scripts\activate && ^
conda update -n base -c defaults conda && ^
conda create -n py${{ matrix.python }} python=${{ matrix.python }} && ^
conda activate py${{ matrix.python }} && ^
conda install -c cbillington setuptools-conda && ^
pip install --upgrade setuptools_scm && ^
setuptools-conda build %CONDA_BUILD_ARGS% .
conda install -c labscript-suite setuptools-conda && ^
setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb .
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -246,19 +231,19 @@ jobs:
user: __token__
password: ${{ secrets.pypi }}

- name: Install Miniconda and cloud client
run: |
curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p .miniconda
source .miniconda/etc/profile.d/conda.sh
conda activate
conda install anaconda-client
- name: Install Miniconda
# 2.0.1 until https://github.com/conda-incubator/setup-miniconda/pull/189 merged
# and released. Then can change to v2
uses: conda-incubator/[email protected]
with:
auto-update-conda: true

- name: Install Anaconda cloud client
run: conda install anaconda-client

- name: Publish to Anaconda test label
if: github.event.ref_type != 'tag'
run: |
source .miniconda/etc/profile.d/conda.sh
conda activate
anaconda \
--token ${{ secrets.ANACONDA_API_TOKEN }} \
upload \
Expand All @@ -269,8 +254,6 @@ jobs:
- name: Publish to Anaconda main label
if: github.event.ref_type == 'tag'
run: |
source .miniconda/etc/profile.d/conda.sh
conda activate
anaconda \
--token ${{ secrets.ANACONDA_API_TOKEN }} \
upload \
Expand Down

0 comments on commit ee69652

Please sign in to comment.