diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a5c227d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish Releases + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ${{ matrix.os }} + name: Publish + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + + steps: + - name: Checkout + uses: actions/checkout@v1 # use the latest code commit + + - name: Setup conda with python ${{ matrix.python-version }} + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + python-version: ${{ matrix.python-version }} + + - name: Initialize powershell for conda (Windows only) + if: runner.os == 'Windows' + run: conda init powershell + + - name: Install dependencies with conda + run: | + conda install anaconda-client conda-build setuptools setuptools_scm + + - name: Build & upload with conda + run: | + # Login to anaconda (answer the resulting prompt with yes) + echo y | anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} --hostname "GitHub_${{ matrix.os }}_${{ matrix.python-version }}" + # Enable automatic upload to anaconda.org + conda config --set anaconda_upload yes + # Run build process + conda build conda.recipe -c conda-forge