Skip to content

Commit a9fdd8f

Browse files
committed
ci: Add automated release pipeline with release-please
- Add GitHub Actions workflow for automated releases and PyPI publishing - Configure release-please for semantic versioning and changelog management - Add release-please manifest and configuration files - Update pyproject.toml to use setuptools_scm for dynamic versioning - Update package name from "etb" to "explodethosebits" for PyPI - Add setuptools_scm configuration for automatic version detection - Update python/etb/__init__.py to import version from _version.py - Update setup.py documentation to reflect new package name - Add CHANGELOG.md with initial release notes - Configure build matrix for Python 3.9-3.12 on Ubuntu and Windows - Add CUDA Toolkit installation and wheel building steps - Enable automated publishing to PyPI on release creation
1 parent 6e70e4a commit a9fdd8f

7 files changed

Lines changed: 188 additions & 11 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
release-type: python
23+
package-name: explodethosebits
24+
25+
build_wheels:
26+
name: Build wheels on ${{ matrix.os }}
27+
needs: release-please
28+
if: ${{ needs.release-please.outputs.release_created }}
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest, windows-latest]
34+
python-version: ['3.9', '3.10', '3.11', '3.12']
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
46+
- name: Install CUDA Toolkit (Linux)
47+
if: runner.os == 'Linux'
48+
uses: Jimver/cuda-toolkit@v0.2.15
49+
with:
50+
cuda: '12.4.0'
51+
method: 'network'
52+
53+
- name: Install CUDA Toolkit (Windows)
54+
if: runner.os == 'Windows'
55+
uses: Jimver/cuda-toolkit@v0.2.15
56+
with:
57+
cuda: '12.4.0'
58+
method: 'network'
59+
60+
- name: Install build dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install build scikit-build-core pybind11 cmake ninja
64+
65+
- name: Build wheel
66+
run: python -m build --wheel
67+
env:
68+
CMAKE_CUDA_ARCHITECTURES: "90;100"
69+
70+
- name: Upload wheels
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
74+
path: dist/*.whl
75+
76+
build_sdist:
77+
name: Build source distribution
78+
needs: release-please
79+
if: ${{ needs.release-please.outputs.release_created }}
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
85+
86+
- name: Set up Python
87+
uses: actions/setup-python@v5
88+
with:
89+
python-version: '3.11'
90+
91+
- name: Install build dependencies
92+
run: |
93+
python -m pip install --upgrade pip
94+
pip install build
95+
96+
- name: Build sdist
97+
run: python -m build --sdist
98+
99+
- name: Upload sdist
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: sdist
103+
path: dist/*.tar.gz
104+
105+
publish:
106+
name: Publish to PyPI
107+
needs: [release-please, build_wheels, build_sdist]
108+
if: ${{ needs.release-please.outputs.release_created }}
109+
runs-on: ubuntu-latest
110+
environment:
111+
name: pypi
112+
url: https://pypi.org/p/explodethosebits
113+
permissions:
114+
id-token: write
115+
116+
steps:
117+
- name: Download all artifacts
118+
uses: actions/download-artifact@v4
119+
with:
120+
path: dist
121+
merge-multiple: true
122+
123+
- name: Publish to PyPI
124+
uses: pypa/gh-action-pypi-publish@release/v1
125+
with:
126+
packages-dir: dist/

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

‎CHANGELOG.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2026-01-20
9+
10+
### Added
11+
- Initial release
12+
- CUDA-accelerated bit extraction engine
13+
- Signature-based file format detection
14+
- Heuristic scoring system
15+
- Early stopping optimization
16+
- Prefix trie for path pruning
17+
- Memoization cache
18+
- Python bindings via pybind11
19+
- Support for Hopper (SM 90) and Blackwell (SM 100) architectures

‎pyproject.toml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["scikit-build-core>=0.3.3", "pybind11>=2.11.0"]
2+
requires = ["scikit-build-core>=0.3.3", "pybind11>=2.11.0", "setuptools-scm>=8.0"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
6-
name = "etb"
7-
version = "0.1.0"
6+
name = "explodethosebits"
7+
dynamic = ["version"]
88
description = "ExplodeThoseBits - CUDA-accelerated exhaustive bit tree analysis"
99
readme = "README.md"
1010
requires-python = ">=3.8"
@@ -65,10 +65,17 @@ cmake.build-type = "Release"
6565
cmake.args = ["-DCMAKE_CUDA_ARCHITECTURES=90;100"]
6666
wheel.packages = ["python/etb"]
6767
wheel.py-api = "cp312"
68+
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
69+
sdist.include = ["python/etb/_version.py"]
6870

6971
[tool.scikit-build.cmake.define]
7072
CMAKE_CUDA_ARCHITECTURES = "90;100"
7173

74+
[tool.setuptools_scm]
75+
write_to = "python/etb/_version.py"
76+
version_scheme = "guess-next-dev"
77+
local_scheme = "no-local-version"
78+
7279
[tool.pytest.ini_options]
7380
testpaths = ["tests/python"]
7481
python_files = ["test_*.py"]

‎python/etb/__init__.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
ExplodeThoseBits (etb) - CUDA-accelerated bit extraction library for forensic analysis.
2+
ExplodeThoseBits (etb) - CUDA-Accelerated exhaustive bit-tree/bit-explosion analysis for digital forensics.
33
44
This library provides tools for extracting individual bits from bytes and
55
systematically reconstructing all possible forward-traversal combinations
@@ -23,12 +23,18 @@
2323
>>> candidates = etb.extract(data, config)
2424
"""
2525

26+
# Version from setuptools_scm
27+
try:
28+
from etb._version import __version__
29+
except ImportError:
30+
__version__ = "0.0.0.dev0"
31+
32+
__author__ = "Odin Glynn-Martin"
33+
2634
# Import the native extension module
2735
try:
2836
from etb._etb import *
2937
from etb._etb import (
30-
__version__,
31-
__author__,
3238
# Core data structures
3339
BitCoordinate,
3440
Path,

‎release-please-config.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "python",
5+
"package-name": "explodethosebits",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"include-component-in-tag": false,
9+
"include-v-in-tag": true,
10+
"changelog-path": "CHANGELOG.md",
11+
"extra-files": [
12+
"python/etb/__init__.py"
13+
]
14+
}
15+
},
16+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
17+
}

‎setup.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
"""
3-
Setup script for etb (ExplodeThoseBits).
3+
Setup script for explodethosebits (etb).
44
55
This file exists for backward compatibility with older pip versions
66
and editable installs. The main configuration is in pyproject.toml.
@@ -9,10 +9,9 @@
99
from skbuild import setup
1010

1111
setup(
12-
name="etb",
13-
version="0.1.0",
14-
description="ExplodeThoseBits - CUDA-accelerated bit extraction library",
15-
author="ETB Team",
12+
name="explodethosebits",
13+
description="ExplodeThoseBits - CUDA-Accelerated exhaustive bit-tree/bit-explosion analysis for digital forensics",
14+
author="Odin Glynn-Martin",
1615
license="MIT",
1716
packages=["etb"],
1817
package_dir={"etb": "python/etb"},

0 commit comments

Comments
 (0)