|
| 1 | +name: Anaconda Publish |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + # use this to test before actual release and publish |
| 7 | + # push: |
| 8 | + # branches: |
| 9 | + # - some_test_branch |
| 10 | + |
| 11 | +jobs: |
| 12 | + |
| 13 | + publish: |
| 14 | + name: publish / python-3.8 / ubuntu-latest |
| 15 | + runs-on: 'ubuntu-latest' |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - uses: goanpeca/setup-miniconda@v1 |
| 19 | + with: |
| 20 | + auto-update-conda: true |
| 21 | + python-version: "3.8" |
| 22 | + miniconda-version: "latest" |
| 23 | + channels: conda-forge |
| 24 | + - name: Show conda config |
| 25 | + shell: bash -l {0} |
| 26 | + run: | |
| 27 | + conda info |
| 28 | + conda list |
| 29 | + conda config --show-sources |
| 30 | + conda config --show |
| 31 | + - name: Python info |
| 32 | + shell: bash -l {0} |
| 33 | + run: | |
| 34 | + which python |
| 35 | + python --version |
| 36 | + - name: Install build dependencies |
| 37 | + shell: bash -l {0} |
| 38 | + run: conda install -y conda-build conda-verify ripgrep anaconda-client |
| 39 | + - name: Build the conda package |
| 40 | + shell: bash -l {0} |
| 41 | + run: | |
| 42 | + conda config --set anaconda_upload no |
| 43 | + export BUILD_FOLDER=/tmp/esmvalcore/_build |
| 44 | + mkdir -p $BUILD_FOLDER |
| 45 | + conda build package \ |
| 46 | + --channel esmvalgroup --channel conda-forge \ |
| 47 | + --croot $BUILD_FOLDER \ |
| 48 | + - name: Push the package to anaconda cloud |
| 49 | + shell: bash -l {0} |
| 50 | + run: | |
| 51 | + export BUILD_FOLDER=/tmp/esmvalcore/_build |
| 52 | + # use --label test before actual release and check all works well |
| 53 | + anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --user esmvalgroup $BUILD_FOLDER/noarch/*.tar.bz2 |
| 54 | + verify: |
| 55 | + name: verify / python-${{ matrix.python-version }} / ${{ matrix.os }} |
| 56 | + strategy: |
| 57 | + fail-fast: false |
| 58 | + matrix: |
| 59 | + os: ['ubuntu-latest'] # may extent to osx in the future |
| 60 | + python-version: ["3.6", "3.7", "3.8"] |
| 61 | + runs-on: ${{ matrix.os }} |
| 62 | + needs: publish |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + with: |
| 66 | + fetch-depth: "0" |
| 67 | + - uses: goanpeca/setup-miniconda@v1 |
| 68 | + with: |
| 69 | + python-version: ${{ matrix.python-version }} |
| 70 | + miniconda-version: "latest" |
| 71 | + channels: esmvalgroup,conda-forge |
| 72 | + - shell: bash -l {0} |
| 73 | + run: conda --version |
| 74 | + - shell: bash -l {0} |
| 75 | + run: which conda |
| 76 | + - shell: bash -l {0} |
| 77 | + run: python -V |
| 78 | + - shell: bash -l {0} |
| 79 | + run: conda install esmvalcore |
| 80 | + - shell: bash -l {0} |
| 81 | + run: esmvaltool --help |
| 82 | + - shell: bash -l {0} |
| 83 | + run: esmvaltool version |
0 commit comments