name: CI build Anaconda

on:
  workflow_dispatch:
  release:
    types:
      - released

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-2019, macos-12]
    name: Build Anaconda packages on ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v3
      - name: Setup conda
        uses: s-weigand/setup-conda@v1
        with:
          update-conda: true
          conda-channels: conda-forge
      
      - name: Prepare conda environment
        run: |
          conda install mamba conda-build conda-verify anaconda-client
          mkdir build_output
          
      - name: Build packages
        run: mamba build --no-anaconda-upload --output-folder ./build_output ./packaging/conda
      
      - uses: actions/upload-artifact@v3
        with:
          name: build_outputs
          path: ./build_output/*/pysces*.tar.bz2

      - name: Upload to anaconda.org
        # to publish when a GitHub Release is created:
        # if: github.event_name == 'release' && github.event.action == 'released'
        run: anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u pysces ./build_output/*/pysces*.tar.bz2

name: CI build Anaconda

on:
  workflow_dispatch:
  release:
    types:
      - released

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-2019, macos-12]
    name: Build Anaconda packages on ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v3
      - name: Setup conda
        uses: s-weigand/setup-conda@v1
        with:
          update-conda: true
          conda-channels: conda-forge
      
      - name: Prepare conda environment
        run: |
          conda install mamba conda-build conda-verify anaconda-client
          mkdir build_output
          
      - name: Build packages
        run: mamba build --no-anaconda-upload --output-folder ./build_output ./packaging/conda
      
      - uses: actions/upload-artifact@v3
        with:
          name: build_outputs
          path: ./build_output/*/pysces*.tar.bz2

      - name: Upload to anaconda.org
        # to publish when a GitHub Release is created:
        if: github.event_name == 'release' && github.event.action == 'released'
        run: anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u pysces ./build_output/*/pysces*.tar.bz2

Revert "enable anaconda upload on manual workflow dispatch (token was expired)"
Revert "enable anaconda upload on manual workflow dispatch (token was expired)"

This reverts commit ce1535a2584bc9520530ff9df145681e44c0774d.
