From aaaf980c008fb3081e61a14bd564bc0095f4af6c Mon Sep 17 00:00:00 2001 From: siddhant Date: Tue, 11 Aug 2026 02:34:29 +0530 Subject: [PATCH 1/2] feat: add pyproject.toml packaging and tag-triggered release workflow Packages minichain as an installable wheel/sdist and adds a GitHub Actions workflow that builds and publishes a GitHub release whenever a version tag (vX.Y.Z[a|b|rc]N) is pushed, marking pre-release versions (beta/rc/alpha) as pre-releases automatically. --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ .gitignore | 5 +++++ pyproject.toml | 37 ++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ab544ee --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + +permissions: + contents: write + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install build tool + run: pip install build + + - name: Build sdist and wheel + run: python -m build + + - name: Determine prerelease flag + id: prerelease + run: | + TAG="${GITHUB_REF_NAME}" + if [[ "$TAG" =~ (a|b|rc)[0-9]+$ ]]; then + echo "is_prerelease=true" >> "$GITHUB_OUTPUT" + else + echo "is_prerelease=false" >> "$GITHUB_OUTPUT" + fi + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true + prerelease: ${{ steps.prerelease.outputs.is_prerelease }} diff --git a/.gitignore b/.gitignore index 8d29416..9d414d1 100644 --- a/.gitignore +++ b/.gitignore @@ -333,5 +333,10 @@ __pycache__/ *bore.zip *bore_bin +# Build artifacts +dist/ +build/ +*.egg-info/ + # minichain data dir .minichain/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..20d3278 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[build-system] +requires = ["setuptools>=68", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "minichain" +version = "0.1.0b1" +description = "MiniChain — a minimal proof-of-work blockchain node" +readme = "README.md" +requires-python = ">=3.10" +license = { text = "MIT" } +dependencies = [ + "pynacl==1.6.2", + "trie>=3.1.0", + "libp2p", + "aiohttp>=3.10.11", + "multiaddr", +] + +[project.optional-dependencies] +test = [ + "pytest>=7.0.0", + "pytest-asyncio>=0.21.0", + "pytest-cov>=4.0.0", +] + +[project.scripts] +minichain = "main:main" + +[project.urls] +Homepage = "https://github.com/StabilityNexus/MiniChain" + +[tool.setuptools] +py-modules = ["main"] + +[tool.setuptools.packages.find] +include = ["minichain*"] From cba844300b6a113b3587625c3baa8e343a25fff1 Mon Sep 17 00:00:00 2001 From: siddhant Date: Tue, 11 Aug 2026 02:38:31 +0530 Subject: [PATCH 2/2] chore: use simple -beta version suffix instead of PEP440 b1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 20d3278..bc9a221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "minichain" -version = "0.1.0b1" +version = "0.1.0-beta" description = "MiniChain — a minimal proof-of-work blockchain node" readme = "README.md" requires-python = ">=3.10"