Skip to content

Commit

Permalink
Add conda publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jnettels committed Jun 6, 2023
1 parent 11a8e4f commit a81a7e4
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a81a7e4

Please sign in to comment.