Skip to content

Commit 01efa75

Browse files
committed
Generate add-on in out/
1 parent 0486fa1 commit 01efa75

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Build package
3333
run: poetry build && python scripts/bb_addon_create.py
3434
- name: Upload release artifacts
35-
run: gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl} dist/nrepl_panel_addon*.py
35+
run: gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl} out/nrepl_panel_addon*.py
3636
env:
3737
GH_TOKEN: ${{ github.token }}
3838
- name: Publish package distributions to PyPI

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__/
44

55
.bb-tmp
66
dist/
7+
out/
78

89
\#*#
910
.#*

scripts/bb_addon_create.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# This script should be invoked from the project root directory.
22
#
3-
# Copies the nrepl_panel_addon.py file to dist adding the version
3+
# Copies the nrepl_panel_addon.py file to out/ adding the version
44
# number as retrieved from `poetry version`.
5+
import os
56
import re
67
import subprocess
78

@@ -11,15 +12,16 @@
1112
result = subprocess.run(["poetry", "version"], capture_output=True, text=True)
1213
_, version = result.stdout.split(" ")
1314
major, minor, patch = version.split(".")
14-
patch_int = int(re.match(r'^\d+', patch).group())
15+
patch_int = int(re.match(r"^\d+", patch).group())
1516

16-
dist_path = f'dist/nrepl_panel_addon_{version.strip().replace(".", "_")}.py'
17+
os.makedirs("out", exist_ok=True)
18+
out_path = f'out/nrepl_panel_addon_{version.strip().replace(".", "_")}.py'
1719

18-
with open(src_path, 'r') as src:
19-
with open(dist_path, 'w', newline="\n") as dst:
20+
with open(src_path, "r") as src:
21+
with open(out_path, "w", newline="\n") as dst:
2022
dst.write(f"# Autogenerated from {src_path}\n")
2123
for line in src.readlines():
2224
if version_mark in line:
2325
line = line.replace(version_mark, f"({major}, {minor}, {patch_int})")
2426
dst.write(line)
25-
print(f":bb_addon_create.py :created {dist_path}")
27+
print(f":bb_addon_create.py :created {out_path}")

0 commit comments

Comments
 (0)