Skip to content

Commit d6442bf

Browse files
authored
Merge pull request #21 from LyceanEM/Build-Testing
Build testing has identified the source of failure to build for the windows packaging
2 parents 29dde3b + 4ecbaba commit d6442bf

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed

.github/workflows/conda_build.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ name: Build
44
on:
55
workflow_dispatch:
66
push:
7-
branches: [ master,Development,Documentation-Updates ]
7+
branches:
8+
- master
9+
- '**'
810
pull_request:
9-
branches: [ master,Development,Documentation-Updates ]
11+
branches:
12+
- master
13+
- '**'
1014

1115
jobs:
1216
build:
@@ -36,6 +40,7 @@ jobs:
3640
defaults:
3741
run:
3842
shell: ${{ matrix.platform.shell }}
43+
3944
env:
4045
REPO: "${{ github.event.pull_request.head.repo.full_name || github.repository }}"
4146
steps:
@@ -45,7 +50,23 @@ jobs:
4550
python-version: ${{ matrix.python-version }}
4651
activate-environment: build_env
4752
miniforge-version: latest
48-
#
53+
54+
# - name: set_label
55+
# id: set_label
56+
# run: |
57+
# BRANCH_NAME=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
58+
# CONDA_LABEL=""
59+
# if [ "$BRANCH_NAME" == "master" ]; then
60+
# CONDA_LABEL="main"
61+
# else
62+
# CONDA_LABEL="dev-${BRANCH_NAME}"
63+
# fi
64+
# echo "CONDA_LABEL=$CONDA_LABEL" >> $GITHUB_ENV
65+
- name: Extract branch name
66+
shell: bash
67+
run: echo "CONDA_LABEL=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
68+
id: extract_branch
69+
4970
- name: Clone the devel branch (push to devel)
5071
run: git clone --branch ${{ github.head_ref || github.ref_name }} https://github.com/${{ env.REPO }}
5172
if: github.event_name != 'pull_request'
@@ -68,4 +89,5 @@ jobs:
6889
env:
6990

7091
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
92+
label: ${{ env.CONDA_LABEL }}
7193
if: github.event_name != 'pull_request'

actions/upload.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import os
33
import sys
44
from pathlib import Path
5+
56
script = os.path.abspath(sys.argv[0])
6-
script_path=Path(script)
7+
script_path = Path(script)
78
# go up one directories to get the source directory
89
# (this script is in Sire/actions/)
910
srcdir = os.path.dirname(os.path.dirname(script))
@@ -50,28 +51,32 @@ def run_cmd(cmd):
5051
gitdir = os.path.join(srcdir, ".git")
5152

5253
tag = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} tag --contains")
53-
branch = run_cmd(f"git --git-dir={gitdir} branch --show-current")
54+
# branch = run_cmd(f"git --git-dir={gitdir} branch --show-current")
5455
# if the branch is master, then this is a main release
55-
#if tag is not None and tag.lstrip().rstrip() != "":
56+
# if tag is not None and tag.lstrip().rstrip() != "":
5657
# print(f"\nTag {tag} is set. This is a 'main' release.")
5758
# label = "--label main"
58-
#else:
59+
# else:
5960
# # this is a development release
6061
# print("\nNo tag is set. This is a 'devel' release.")
6162
# label = "--label dev"
62-
print("branch is " , branch)
63-
if branch=="master":
64-
print(f"\nBranch {branch} is set. This is a 'main' release.")
63+
64+
# Get the label
65+
if "CONDA_LABEL" in os.environ:
66+
branch_label = os.environ["CONDA_LABEL"]
67+
else:
68+
branch_label = "TEST"
69+
print("branch is ", branch_label)
70+
if branch_label == "master":
71+
print(f"\nBranch {branch_label} is set. This is a 'main' release.")
6572
label = "--label main"
6673
else:
6774
# this is a development release
68-
print(f"\nBranch {branch} is set. This is a 'devel' release.")
69-
label = "--label dev"
75+
print(f"\nBranch {branch_label} is set. This is a 'devel' release.")
76+
# label = "--label dev"
7077

7178
# Upload the packages to the michellab channel on Anaconda Cloud.
72-
cmd = (
73-
f"anaconda --token {conda_token} upload --user LyceanEM {label} --force {packages}"
74-
)
79+
cmd = f"anaconda --token {conda_token} upload --user LyceanEM --label {branch_label} --force {packages}"
7580

7681
print(f"\nUpload command:\n\n{cmd}\n")
7782

conda/meta.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ requirements:
3636
- conda-forge::ninja
3737
- conda-forge::scikit-build
3838
- nvidia::cuda-nvcc
39-
40-
- conda-forge::cxx-compiler
39+
- {{ compiler('cxx') }}
4140

4241
# NVIDIA components to build CUDA code (no full runtime)
4342
- nvidia::cuda-nvcc

0 commit comments

Comments
 (0)