Skip to content

Commit 17a5fb1

Browse files
committed
Add publish to conda build
1 parent c95f10a commit 17a5fb1

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
run: hatch publish --user __token__ --auth ${{ secrets.pypi_password }}
2424
conda-build:
2525
runs-on: ubuntu-latest
26+
env:
27+
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
2628
defaults:
2729
run:
2830
shell: bash -el {0}
@@ -36,7 +38,20 @@ jobs:
3638
channels: pyviz/label/dev,conda-forge
3739
- name: Install conda-build and hatch
3840
run: |
39-
conda install -y conda-build hatch
41+
conda install -y conda-build hatch anaconda-client
4042
- name: Build conda package
4143
run: |
42-
bash ./scripts/build_conda.sh
44+
bash scripts/build_conda.sh
45+
- name: Publish
46+
if: github.event_name == 'release' && github.event.action == 'published'
47+
run: hatch publish --user __token__ --auth ${{ secrets.pypi_password }}
48+
- name: conda dev upload
49+
if: (github.event_name == 'release' && github.event.action == 'published' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
50+
run: |
51+
FILE=$(VERSION=`hatch version` conda build --output conda/recipe)
52+
anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev $FILE
53+
- name: conda main upload
54+
if: (github.event_name == 'release' && github.event.action == 'published' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
55+
run: |
56+
FILE=$(VERSION=`hatch version` conda build --output conda/recipe)
57+
# anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev --label=main $FILE

conda/scripts.sh

Whitespace-only changes.

scripts/build_conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ git status
66

77
hatch build --clean
88

9-
export VERSION="$(echo "$(ls dist/*.whl)" | cut -d- -f2)"
9+
export VERSION="$(hatch version)"
1010
conda build conda/recipe --no-test --no-anaconda-upload --no-verify

0 commit comments

Comments
 (0)