Skip to content

Commit 264e801

Browse files
committed
restructured conda recipe
1 parent f7ca5ba commit 264e801

2 files changed

Lines changed: 34 additions & 28 deletions

File tree

.github/workflows/conda_release.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,41 @@ jobs:
3535
curl -L $TAR_URL -o release.tar.gz
3636
SHA256=$(sha256sum release.tar.gz | cut -d' ' -f1)
3737
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT
38+
# Extract OWNER and REPO from GITHUB_REPOSITORY (format: owner/repo)
39+
REPO_OWNER=${GITHUB_REPOSITORY%%/*}
40+
echo "REPO_OWNER=$REPO_OWNER" >> $GITHUB_OUTPUT
41+
REPO_NAME=${GITHUB_REPOSITORY##*/}
42+
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_OUTPUT
43+
REPO_HOME="https://github.com/${GITHUB_REPOSITORY}"
44+
echo "REPO_HOME=$REPO_HOME" >> $GITHUB_OUTPUT
45+
echo "$GITHUB_OUTPUT"
3846
3947
# 4) Update meta.yaml with the correct version and sha256
4048
- name: Patch conda-recipe/meta.yaml
4149
run: |
4250
cd conda-recipe
4351
44-
# Extract OWNER and REPO from GITHUB_REPOSITORY (format: owner/repo)
45-
OWNER=${GITHUB_REPOSITORY%%/*}
46-
REPO=${GITHUB_REPOSITORY##*/}
47-
52+
# Replace the Jinja “{% set name = "..." %}” line:
53+
sed -i "s|^{% set name = \".*\" %}|{% set name = \"${{ steps.vars.outputs.REPO_NAME }}\" %}|" meta.yaml
54+
4855
# Replace the Jinja “{% set version = "..." %}” line:
4956
sed -i "s|^{% set version = \".*\" %}|{% set version = \"${{ steps.vars.outputs.VERSION }}\" %}|" meta.yaml
50-
51-
# Replace the “ sha256: ...” line (two‐space indentation under source:)
52-
sed -i "s|^ sha256: .*| sha256: ${{ steps.vars.outputs.SHA256 }}|" meta.yaml
5357
5458
# Update the source URL to use the real owner, repo, and version
5559
# Original line looks like:
5660
# url: <PLACEHOLDER>
57-
sed -i "s|^ url: .*| url: https://github.com/${OWNER}/${REPO}/archive/v${{ steps.vars.outputs.VERSION }}.tar.gz|" meta.yaml
61+
sed -i "s|^ url: .*| url: ${{ steps.vars.outputs.TAR_URL }}|" meta.yaml
62+
63+
# Replace the “ sha256: ...” line (two‐space indentation under source:)
64+
# Original line looks like:
65+
# sha256: <PLACEHOLDER>
66+
sed -i "s|^ sha256: .*| sha256: ${{ steps.vars.outputs.SHA256 }}|" meta.yaml
5867
5968
# Update the homepage URL to use the real owner and repo
6069
# Original line looks like:
6170
# home: <PLACEHOLDER>
62-
sed -i "s|^ home: .*| home: https://github.com/${OWNER}/${REPO}|" meta.yaml
71+
sed -i "s|^ home: .*| home: ${{ steps.vars.outputs.REPO_HOME }}|" meta.yaml
6372
64-
# check meta.yaml contents
6573
cat meta.yaml
6674
6775
# 5) Build the conda package

conda-recipe/meta.yaml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,29 @@ source:
1010
sha256: <PLACEHOLDER>
1111

1212
build:
13-
number: 0
14-
requirements:
15-
build:
16-
- {{ compiler("cxx") }}
17-
- cmake
18-
- python
19-
- pip
20-
- setuptools
21-
- scikit-build
22-
host:
23-
- python
24-
- pip
25-
- setuptools
26-
- scikit-build
27-
run:
28-
- python
29-
13+
skip: true # [not win]
3014
script: |
3115
mkdir build
3216
cd build
3317
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
3418
cmake --build . --parallel ${CPU_COUNT:-1}
3519
cmake --install . --prefix $PREFIX
3620
cd ..
37-
pip install . -vv
21+
{{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
22+
number: 0
23+
24+
requirements:
25+
build:
26+
- {{ compiler("cxx") }}
27+
- cmake
28+
- python >=3.10
29+
- pip
30+
- setuptools
31+
- scikit-build
32+
host:
33+
- python >=3.10
34+
run:
35+
- python >=3.10
3836

3937
about:
4038
home: <PLACEHOLDER>

0 commit comments

Comments
 (0)