-
Notifications
You must be signed in to change notification settings - Fork 58
37 lines (34 loc) · 1.24 KB
/
python-package-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
name: Python Package using Conda
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v3
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pyepo-build
python-version: 3.9
auto-activate-base: false
- name: Install Conda-Build and Anaconda-Client
run: conda install conda-build anaconda-client
- name: Build Conda Package
run: conda build ./pkg -c conda-forge -c pytorch -c gurobi -c default
- name: Extract Package Version
run: |
PACKAGE_VERSION=$(conda search --json -c local pyepo | jq -r '.pyepo[-1].version')
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Find and Upload Conda Package
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: |
CONDA_BLD_PATH=$(conda info --json | jq -r '.conda_prefix')/conda-bld
echo "Conda build path: $CONDA_BLD_PATH"
conda install -n pyepo-build anaconda-client --yes
conda run -n pyepo-build anaconda upload --user pyepo $CONDA_BLD_PATH/noarch/pyepo-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2