Skip to content

Commit

Permalink
factory: Setup release script
Browse files Browse the repository at this point in the history
  • Loading branch information
theacodes committed Jul 22, 2021
1 parent 63d5331 commit bf7aa13
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/releasing/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2021 Alethea Katherine Flowers.
# Published under the standard MIT License.
# Full text available at: https://opensource.org/licenses/MIT

import os
import os.path
import shutil
import subprocess
import sys

import jinja2
from __main__ import add_artifact

message_template = jinja2.Template(
open(os.path.join(os.path.dirname(__file__), "template.jinja2"), "r").read()
)

def prepare_artifacts(info):
os.chdir("factory")

if os.path.exists("distribution"):
shutil.rmtree("distribution")

subprocess.run([sys.executable, "factory_setup.py", "publish"])

print("Zipping up distribution...")
os.chdir("distribution")
subprocess.run(["zip", "-r", "-q", "distribution.zip", "."])

os.chdir("../..")

add_artifact(
"factory/distribution/distribution.zip",
f"big-honking-button-{info['tag']}.zip",
)


def prepare_description(info, artifacts):
return message_template.render(artifacts=artifacts, **info)
15 changes: 15 additions & 0 deletions .github/releasing/template.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This is a bugfix & maintenance release for Big Honking Button's CircuitPython libraries.

👉 **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** 👈

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.

## Changes from {{last_release}}

{%- for category, category_changes in changes.items() %}

{{category}}:
{% for change in category_changes %}
* {{change.capitalize()}}
{%- endfor %}
{%- endfor %}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ dist
.vscode
.nox
.coverage
.cache
logs/
factory/distribution
Binary file removed factory/sync.exe
Binary file not shown.

0 comments on commit bf7aa13

Please sign in to comment.