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..bc9a221 --- /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.0-beta" +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*"]