Skip to content

Commit 48c3e80

Browse files
Separate jobs correctly
1 parent 0e2bb77 commit 48c3e80

File tree

1 file changed

+46
-23
lines changed

1 file changed

+46
-23
lines changed

.github/workflows/conda_build_and_publish.yml

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,58 @@ on:
44
release:
55
types: [published]
66
push:
7-
branches: [ master ]
7+
branches: [master]
88
tags:
99
- '**'
1010
pull_request:
11-
branches: [ master ]
12-
11+
branches: [master]
12+
1313
jobs:
1414
build:
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
- uses: conda-incubator/setup-miniconda@v3
21-
with:
22-
python-version: 3.7
23-
mamba-version: "*"
24-
channels: conda-forge, ccpi
25-
conda-remove-defaults: "true"
26-
- run: conda install boa conda-verify
27-
- name: conda build
28-
run: >
29-
conda mambabuild -c conda-forge -c ccpi --python=3.7 --output-folder dist recipe
30-
- name: conda-upload
31-
if: github.ref == startsWith(github.ref, 'refs/tags')
32-
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
33-
runs-on: ubuntu-latest
34-
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # All history for use later with the meta.yaml file for conda-recipes
20+
21+
- uses: conda-incubator/setup-miniconda@v3
22+
with:
23+
python-version: 3.7
24+
mamba-version: "*"
25+
channels: conda-forge, ccpi
26+
conda-remove-defaults: "true"
27+
28+
- run: conda install boa conda-verify
29+
30+
- name: conda build
31+
run: >
32+
conda mambabuild -c conda-forge -c ccpi --python=3.7 --output-folder dist recipe
33+
34+
- name: Upload conda package as artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: cilviewer
38+
path: dist
39+
40+
conda-upload:
41+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
42+
runs-on: ubuntu-latest
43+
needs: build
44+
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
45+
steps:
46+
- uses: conda-incubator/setup-miniconda@v3
47+
with:
48+
mamba-version: "*"
49+
channels: conda-forge
50+
51+
- name: Download built conda package
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: cilviewer
55+
path: dist
56+
3557
- run: mamba install anaconda-client
36-
- name: anaconda upload -c ccpi
58+
59+
- name: Upload to ccpi anaconda channel
3760
run: >
38-
anaconda -v -t ${{ secrets.ANACONDA_TOKEN }} upload --force --label 'main' noarch/*
61+
anaconda -v -t ${{ secrets.ANACONDA_TOKEN }} upload --force --label 'main' dist/noarch/*

0 commit comments

Comments
 (0)