Skip to content

Commit

Permalink
try uploading to anaconda.org (#2123)
Browse files Browse the repository at this point in the history
* try uploading to anaconda.org

* gcp and anaconda-client

* another token attempt

* right dir separator?

* another path?

* order args

* show silent fails

* extra dep

* quicker

* right path?

* right path 2?

* right path 3

* right path 5

* right path 6?

* it works

* tidyup
  • Loading branch information
loriab committed Mar 4, 2021
1 parent 34968f5 commit 4006265
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .azure-pipelines/azure-pipelines-windows.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
llvm.version: '11.0.0'
mkl.version: '2019.1'
cmake.build_type: 'Release'
conda.build: true
conda.build: false
MKL_CBWR: AVX
PYTHON_VERSION: '3.8'
steps:
Expand Down Expand Up @@ -112,6 +112,7 @@ jobs:
# Note: c-f eigen has Config.cmake file
- script: |
conda install cmake ^
anaconda-project ^
conda-build ^
conda-forge::eigen ^
conda-verify ^
Expand All @@ -127,6 +128,7 @@ jobs:
pytest-xdist ^
python=%PYTHON_VERSION% ^
psi4/label/dev::dftd3 ^
psi4/label/dev::gcp ^
conda-forge::gau2grid ^
psi4/label/dev::libint2 ^
conda-forge::libxc ^
Expand All @@ -135,6 +137,9 @@ jobs:
conda-forge::qcelemental ^
conda-forge::qcengine
pip install git+https://github.com/i-pi/i-pi.git@master-py3
conda install --only-deps anaconda-client
pip install git+https://github.com/loriab/anaconda-client.git@upload-catch-silent
which anaconda
conda list
displayName: "Install conda packages"
Expand Down Expand Up @@ -249,12 +254,34 @@ jobs:
conda build --python %PYTHON_VERSION% ^
conda\win
copy /y C:\tools\miniconda3\conda-bld\win-64\psi4-*.bz2 $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), eq(variables['conda.build'], 'true'))
condition: and(succeeded(), or(eq(variables['conda.build'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
displayName: "Build Psi4 package"
# Publish package
- task: PublishBuildArtifacts@1
inputs:
artifactName: conda
condition: and(succeeded(), eq(variables['conda.build'], 'true'))
condition: and(succeeded(), or(eq(variables['conda.build'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
displayName: "Publish Psi4 package"

# Upload package
# * use same ANACONDA_TOKEN generated on anaconda.org for GHA and save it in Azure DevOps
# at /psi4/psi4/Pipelines/psi4.psi4 -> Edit button -> Variables button -> new secret var `conda.anaconda_org_token`.
# * error handling may need tweaking as I don't know if failure to upload for lack of space (`echo $?`=1) will fail the workflow.
- bash: |
set -e
ls -l /c/tools/miniconda3/conda-bld/win-64/*.tar.bz2
echo "Using the mapped env var for this task works and is recommended: $(conda.anaconda_org_token)"
anaconda whoami
anaconda \
--verbose \
upload \
--label dev \
--skip \
/c/tools/miniconda3/conda-bld/win-64/*.tar.bz2
echo $?
env:
ANACONDA_API_TOKEN: $(conda.anaconda_org_token)
condition: and(succeeded(), or(eq(variables['conda.build'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
displayName: "Upload Psi4 package to anaconda.org"
1 change: 1 addition & 0 deletions azure-pipelines.yml
@@ -1,5 +1,6 @@
trigger:
- master
- 1.4.x
- 1.3.x
- 1.2.x
- 1.1.x
Expand Down
1 change: 1 addition & 0 deletions conda/win/meta.yaml
Expand Up @@ -22,6 +22,7 @@ requirements:
- libint2
- libxc
- dftd3
- gcp

build:
string: py{{ environ['PY_VER'].replace('.', '') }}_{{ 'debug' if environ['CMAKE_BUILD_TYPE'] == 'Debug' else '0' }}
Expand Down

0 comments on commit 4006265

Please sign in to comment.