Skip to content

Commit f091b39

Browse files
Merge branch 'main' of https://github.com/NHSDigital/data-validation-engine into hotfix/ci_issue_with_conda_publish
2 parents 37e810d + 5bca4ff commit f091b39

1 file changed

Lines changed: 61 additions & 18 deletions

File tree

.github/workflows/ci_conda_publish.yml

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,85 @@ name: CI Conda Publish
33
on: workflow_dispatch
44

55
jobs:
6-
publish-to-conda:
7-
name: Publish to Conda
8-
# if: startsWith(github.ref, 'refs/tags/')
9-
# needs:
10-
# - publish-to-pypi
11-
runs-on: conda/miniconda3:latest
12-
environment: conda
6+
build:
7+
name: Build conda artifact
8+
runs-on: ubuntu-24.04
139
steps:
14-
- name: Install conda requirements
15-
run: |
16-
conda install anaconda-client conda-build
10+
- name: Setup conda
11+
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
12+
with:
13+
auto-update-conda: true
14+
python-version: "3.11"
1715

18-
- name: Install Grayskull
16+
- name: Install conda requirements
17+
shell: bash -el {0}
1918
run: |
20-
conda install -c conda-forge grayskull=3.1.0
19+
conda install -c conda-forge conda-build grayskull=3.1.0
2120
2221
- name: Build conda metadata
22+
shell: bash -el {0}
2323
run: |
2424
conda grayskull pypi data-validation-engine
2525
26-
- name: Replace incorrect values
26+
- name: Replace default & incorrect values in the recipe
2727
run: |
2828
sed -i 's/- AddYourGitHubIdHere/- georgeRobertson\n - stevenhsd/' ./data-validation-engine/meta.yaml
2929
sed -i 's/- data_validation_engine/- dve/' ./data-validation-engine/meta.yaml
3030
3131
- name: Build Conda packages
32+
shell: bash -el {0}
3233
run: |
3334
conda config --set anaconda_upload no
3435
make cdist
36+
CONDA_ART="$(find conda_dist/noarch/ -type f -name '*.conda' | head -n 1)"
37+
echo "CONDA_ART=$CONDA_ART" >> "$CONDA_ART"
3538
36-
- name: upload dist
39+
- name: Upload Conda Artifact
40+
uses: actions/upload-artifact@v5
41+
with:
42+
name: conda-artifacts
43+
path: $CONDA_ART
44+
45+
- name: Conda cleanup
46+
shell: bash -el {0}
47+
run: conda build purge
48+
49+
publish-to-conda:
50+
name: Publish to Conda
51+
needs:
52+
- build
53+
runs-on: ubuntu-24.04
54+
environment: conda
55+
steps:
56+
- name: Setup Conda
57+
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
58+
with:
59+
auto-update-conda: true
60+
python-version: "3.11"
61+
62+
- name: Install conda dependencies
63+
shell: bash -el {0}
64+
run: |
65+
conda install anaconda-client
66+
67+
- name: Download conda art
68+
uses: actions/download-artifact@v6
69+
with:
70+
name: conda-artifacts
71+
path: conda_dist/
72+
73+
- name: Obtain conda artifact
74+
shell: bash -el {0}
75+
run: |
76+
CONDA_ART="$(find conda_dist/noarch/ -type f -name '*.conda' | head -n 1)"
77+
echo "CONDA_ART=$CONDA_ART" >> "$CONDA_ART"
78+
79+
- name: Upload Conda Artifact
3780
env:
3881
ANACONDA_TOKEN = ${{ secrets.ANACONDA_TOKEN }}
3982
ANACONDA_USER = ${{ secrets.ANACONDA_USER }}
83+
shell: bash -el {0}
4084
run: |
41-
anaconda upload conda_dist/noarch/*.conda --token "$ANACONDA_TOKEN" --user "$ANACONDA_USER"
42-
43-
- name: cleanup
44-
run: conda build purge
85+
anaconda login --user "$ANACONDA_USER"
86+
anaconda upload --user "$ANACONDA_USER" "$CONDA_ART"
87+
# TODO - haven't been able to get the login working. Needs fixing

0 commit comments

Comments
 (0)