Skip to content

Commit 86e75e9

Browse files
committed
Bump version to 0.2.0 and add Conda‐release workflow
1 parent ae02612 commit 86e75e9

4 files changed

Lines changed: 102 additions & 2 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Conda Release to Anaconda.org
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build-and-upload:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# 1) Check out the current repo (so we can access conda-recipe/)
14+
- name: Check out repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
# 2) Install Miniconda and conda-build/anaconda-client
20+
- name: Install Miniconda and tools
21+
run: |
22+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
23+
bash miniconda.sh -b -p $HOME/miniconda
24+
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
25+
conda install -y conda-build anaconda-client
26+
27+
# 3) Determine VERSION (strip the leading “v”) and compute SHA256
28+
- name: Set version and SHA256
29+
id: vars
30+
run: |
31+
VERSION=${GITHUB_REF_NAME#v}
32+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
33+
# Download tarball for this tag and compute checksum
34+
TAR_URL="https://github.com/${GITHUB_REPOSITORY}/archive/refs/tags/v${VERSION}.tar.gz"
35+
curl -L $TAR_URL -o release.tar.gz
36+
SHA256=$(sha256sum release.tar.gz | cut -d' ' -f1)
37+
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT
38+
39+
# 4) Update meta.yaml with the correct version and sha256
40+
- name: Patch conda-recipe/meta.yaml
41+
run: |
42+
cd conda-recipe
43+
sed -i "s/^ version: .*/ version: ${{ steps.vars.outputs.VERSION }}/" meta.yaml
44+
sed -i "s/^ sha256: .*/ sha256: ${{ steps.vars.outputs.SHA256 }}/" meta.yaml
45+
46+
# 5) Build the conda package
47+
- name: Build conda package
48+
run: |
49+
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
50+
cd conda-recipe
51+
conda-build . --output-folder ../conda-build-artifacts
52+
53+
# 6) Upload the built package to Anaconda.org
54+
- name: Upload to Anaconda.org
55+
env:
56+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
57+
run: |
58+
eval "$($HOME/miniconda/bin/conda shell.bash hook)"
59+
PACKAGE=$(ls conda-build-artifacts/linux-64/aligncount-demo-${{ steps.vars.outputs.VERSION }}-*.tar.bz2)
60+
anaconda -t $ANACONDA_TOKEN upload $PACKAGE --user $ANACONDA_USER --label main --force

conda-recipe/meta.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{% set name = "aligncount-demo" %}
2+
{% set version = "0.1.0" %}
3+
4+
package:
5+
name: {{ name }}
6+
version: {{ version }}
7+
8+
source:
9+
url: https://github.com/your-username/aligncount-demo/archive/v{{ version }}.tar.gz
10+
sha256: <PLACEHOLDER>
11+
12+
build:
13+
number: 0
14+
requirements:
15+
build:
16+
- {{ compiler("cxx") }}
17+
- cmake
18+
- python
19+
- pip
20+
- scikit-build
21+
- setuptools
22+
host:
23+
- python
24+
- pip
25+
run:
26+
- python
27+
28+
script: |
29+
mkdir build
30+
cd build
31+
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
32+
cmake --build . --parallel ${CPU_COUNT:-1}
33+
cmake --install . --prefix $PREFIX
34+
cd ..
35+
python -m pip install . --no-deps --ignore-installed -vv
36+
37+
about:
38+
home: https://github.com/your-username/aligncount-demo
39+
license: MIT
40+
summary: "C++ linecount + Python wrapper"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "aligncount_demo"
7-
version = "0.1.0"
7+
version = "0.2.0"
88
description = "Aligncount wrapper"
99

1010
[project.scripts]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="aligncount_demo",
6-
version="0.1.0",
6+
version="0.2.0",
77
description="Aligncount wrapper",
88
packages=["cli"],
99
entry_points={"console_scripts": ["aligncount=cli.entrypoint:main"]},

0 commit comments

Comments
 (0)