Skip to content

Commit 37427a0

Browse files
committed
Setup dynamic versioning
1 parent e6749b8 commit 37427a0

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and release repo-smith to PyPi
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
packages: read
13+
issues: read
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: action/checkout@v3
22+
23+
- name: Setup Python
24+
uses: action/setup-python@v5
25+
with:
26+
python-version: "3.13"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
33+
- name: Build binary
34+
run: |
35+
echo "__version__ = \"${GITHUB_REF_NAME}\"" > src/repo_smith/version.py
36+
python -m build
37+
38+
- name: Publish
39+
run: |
40+
python -m twine upload --skip-existing --verbose dist/*

pyproject.toml

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

55
[project]
66
name = "repo-smith"
7-
version = "0.11.0"
7+
dynamic = ["version"]
88
authors = [{ name = "Jiahao, Woo", email = "woojiahao1234@gmail.com" }]
99
description = "YAML-based configuration for initializing Git repositories for unit testing"
1010
readme = "README.md"
@@ -26,3 +26,6 @@ Issues = "https://github.com/git-mastery/repo-smith/issues"
2626
[tool.pytest.ini_options]
2727
addopts = ["--import-mode=importlib"]
2828
pythonpath = "src"
29+
30+
[tool.hatch.version]
31+
path = "src/repo_smith/version.py"

src/repo_smith/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.0"

0 commit comments

Comments
 (0)