# Build Conda Package

name: Conda package

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  example-1:
    name: Conda package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4
      - uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: rio
          python-version: 3.8
          auto-update-conda: true
          allow-softlinks: true
          channels: conda-forge
          show-channel-urls: true
          channel-priority: flexible
          environment-file: conda-build/environment.yml
          auto-activate-base: false
      - name: Conda build
        shell: pwsh
        run: |
          conda config --set always_yes yes --set changeps1 no
          conda build .
          Copy-Item $env:CONDA_PREFIX\conda-bld -Destination . -Recurse
      - name: Locate file
        run: |
          ARTIFACT_PATH=$(find conda-bld/noarch/*.tar.bz2)
          ARTIFACT_NAME=$(basename $ARTIFACT_PATH)
          echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $GITHUB_ENV
          echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
      - uses: actions/upload-artifact@v2
        with:
          name: ${{ env.ARTIFACT_NAME }}
          path: ${{ env.ARTIFACT_PATH }}


# Build Conda Package

name: Conda package

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  example-1:
    name: Conda package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4
      - uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: rio
          python-version: 3.8
          auto-update-conda: true
          allow-softlinks: true
          channels: conda-forge
          show-channel-urls: true
          channel-priority: flexible
          auto-activate-base: false
      - name: Conda build
        shell: pwsh
        run: |
          conda config --set always_yes yes --set changeps1 no
          conda build .
          Copy-Item $env:CONDA_PREFIX\conda-bld -Destination . -Recurse
      - name: Locate file
        run: |
          ARTIFACT_PATH=$(find conda-bld/noarch/*.tar.bz2)
          ARTIFACT_NAME=$(basename $ARTIFACT_PATH)
          echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $GITHUB_ENV
          echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
      - uses: actions/upload-artifact@v2
        with:
          name: ${{ env.ARTIFACT_NAME }}
          path: ${{ env.ARTIFACT_PATH }}


Remove environment file from conda workflow
Remove environment file from conda workflow
