Skip to content

Commit bf7aa13

Browse files
committed
factory: Setup release script
1 parent 63d5331 commit bf7aa13

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

.github/releasing/config.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2021 Alethea Katherine Flowers.
2+
# Published under the standard MIT License.
3+
# Full text available at: https://opensource.org/licenses/MIT
4+
5+
import os
6+
import os.path
7+
import shutil
8+
import subprocess
9+
import sys
10+
11+
import jinja2
12+
from __main__ import add_artifact
13+
14+
message_template = jinja2.Template(
15+
open(os.path.join(os.path.dirname(__file__), "template.jinja2"), "r").read()
16+
)
17+
18+
def prepare_artifacts(info):
19+
os.chdir("factory")
20+
21+
if os.path.exists("distribution"):
22+
shutil.rmtree("distribution")
23+
24+
subprocess.run([sys.executable, "factory_setup.py", "publish"])
25+
26+
print("Zipping up distribution...")
27+
os.chdir("distribution")
28+
subprocess.run(["zip", "-r", "-q", "distribution.zip", "."])
29+
30+
os.chdir("../..")
31+
32+
add_artifact(
33+
"factory/distribution/distribution.zip",
34+
f"big-honking-button-{info['tag']}.zip",
35+
)
36+
37+
38+
def prepare_description(info, artifacts):
39+
return message_template.render(artifacts=artifacts, **info)

.github/releasing/template.jinja2

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This is a bugfix & maintenance release for Big Honking Button's CircuitPython libraries.
2+
3+
👉 **TL;DR download [big-honking-button-{{tag}}.zip](https://github.com/{{repo}}/releases/download/{{tag}}/big-honking-button-{{tag}}.zip) and extract it to your `CIRCUITPY` drive** 👈
4+
5+
Please follow the [firmware upgrade instructions](https://honk.wntr.dev/#updating-the-firmware) in the user's guide to upgrade your device's firmware and libraries.
6+
7+
## Changes from {{last_release}}
8+
9+
{%- for category, category_changes in changes.items() %}
10+
11+
{{category}}:
12+
{% for change in category_changes %}
13+
* {{change.capitalize()}}
14+
{%- endfor %}
15+
{%- endfor %}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ dist
1212
.vscode
1313
.nox
1414
.coverage
15+
.cache
16+
logs/
17+
factory/distribution

factory/sync.exe

-140 KB
Binary file not shown.

0 commit comments

Comments
 (0)