-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup miniconda action #29
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
|
@@ -97,50 +97,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 | ||
|
@@ -243,19 +228,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 \ | ||
|
@@ -266,8 +251,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 \ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the result of many hours of misery.
Some builds of projects with C extensions fail with errors like:
This is because of long filepaths. The conda build would be done in a directory like:
D:\a\labscript-c-extensions\labscript-c-extensions\conda_build\conda-bld\
Using
${{ runner.temp }}\cb
instead results in the conda build being done in the directory:D:\a\_temp\cb\
saving many characters in the filepath and causing the builds to not fail with the "input line too long" error