-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from rpanderson/setup-miniconda-action
Setup miniconda action
- Loading branch information
Showing
1 changed file
with
24 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ on: | |
|
||
defaults: | ||
run: | ||
shell: bash | ||
shell: bash -l {0} | ||
|
||
env: | ||
PACKAGE_NAME: workflow-sandbox | ||
|
@@ -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 | ||
|
@@ -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 \ | ||
|
@@ -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 \ | ||
|