Skip to content

Commit 4eb46ca

Browse files
authored
Merge pull request #118 from kayjan/publish-to-conda-fix
Add job dependency and env var in github action
2 parents cb6e964 + c9a0835 commit 4eb46ca

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.github/workflows/conda-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,35 @@ on:
99
- completed
1010

1111
jobs:
12+
setup:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Set env var
16+
id: set-env-var-version
17+
run: |
18+
echo VERSION_NUMBER=$(python -c 'import bigtree; print(bigtree.__version__)') >> $GITHUB_OUTPUT
19+
- name: Set env var 2
20+
id: set-env-var-sha256
21+
env:
22+
VERSION_NUMBER: ${{ steps.set-env-var-version.outputs.VERSION_NUMBER }}
23+
run: |
24+
echo SHA256=$(curl -sL https://github.com/kayjan/bigtree/archive/${VERSION_NUMBER}.tar.gz | openssl sha256) >> $GITHUB_OUTPUT
1225
publish:
1326
runs-on: ubuntu-latest
27+
needs: setup
1428
steps:
1529
- uses: actions/checkout@v3
1630
- name: Set up Conda
1731
run: |
1832
conda install -c conda-forge conda-build conda-verify anaconda-client
1933
- name: Publish to conda
34+
env:
35+
CONDA_USERNAME: ${{ secrets.CONDA_USERNAME }}
36+
CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
37+
VERSION_NUMBER: ${{ steps.set-env-var-version.outputs.VERSION_NUMBER }}
38+
SHA256: ${{ steps.set-env-var-sha256.outputs.SHA256 }}
2039
run: |
2140
cd conda
41+
anaconda login --username $CONDA_USERNAME --password $CONDA_PASSWORD
2242
conda config --set anaconda_upload yes
2343
conda build -c conda-forge --output-folder . .

conda/meta.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{% set name = "bigtree" %}
2-
{% set version = "0.14.3" %}
32

43
package:
54
name: "{{ name|lower }}"
6-
version: "{{ version }}"
5+
version: {{ environ.get('VERSION_NUMBER') }}
76

87
source:
9-
url: https://github.com/kayjan/{{ name }}/archive/refs/tags/{{ version }}.tar.gz
10-
sha256: b9e5390879381acfd3ca9018892f9518c821d47c768bb94adf29d069198ebbdb
8+
url: https://github.com/kayjan/{{ name }}/archive/refs/tags/{{ environ.get('VERSION_NUMBER') }}.tar.gz
9+
sha256: {{ environ.get('SHA256') }}
1110

1211
build:
1312
number: 0

0 commit comments

Comments
 (0)