-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (35 loc) · 1.15 KB
/
python-publish-conda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Publish Python Package to conda
on:
release:
types: [published]
jobs:
conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9']
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install dependencies
run: |
conda install -y anaconda-client conda-build
conda install -y setuptools setuptools_scm
- name: Update recipe with version variable
run: |
VERSION=$(python setup.py --version)
LINE_STR='{% set version = "'${VERSION}'" %}'
RECIPE_PATH='recipe/meta.yaml'
echo $LINE_STR | cat - $RECIPE_PATH > temp && mv temp $RECIPE_PATH
- name: Build and publish
env:
CONDA_USERNAME: ${{ secrets.CONDA_USERNAME }}
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
run: |
conda config --set anaconda_upload yes
conda build -c defaults -c conda-forge --token $CONDA_TOKEN --user $CONDA_USERNAME .