New conda build and pub action #1003
This file contains hidden or 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
| name: publish_conda | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: [master] | |
| tags: | |
| - '**' | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # All history for use later with the meta.yaml file for conda-recipes | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: 3.11 | |
| mamba-version: "*" | |
| channels: conda-forge, ccpi | |
| conda-remove-defaults: "true" | |
| - run: conda install boa conda-verify | |
| - name: conda build | |
| run: > | |
| conda mambabuild -c conda-forge -c ccpi --python=3.7 --output-folder dist recipe | |
| - name: Upload conda package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cilviewer | |
| path: dist | |
| conda-upload: | |
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| needs: build | |
| defaults: {run: {shell: 'bash -el {0}', working-directory: dist}} | |
| steps: | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| mamba-version: "*" | |
| channels: conda-forge | |
| - name: Download built conda package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cilviewer | |
| path: dist | |
| - run: mamba install anaconda-client | |
| - name: Upload to ccpi anaconda channel | |
| run: > | |
| anaconda -v -t ${{ secrets.ANACONDA_TOKEN }} upload --force --label 'main' dist/noarch/* |