Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build

on:
- pull_request
- workflow_call

jobs:
build:
Expand All @@ -21,18 +22,25 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox

- name: Build
run: tox -e build

- name: tar
run: tar -cf mcbootflash.tar dist/mcbootflash*

- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: dist/mcbootflash*
path: mcbootflash.tar
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
release:
types:
- created

jobs:
set-body:
runs-on: ubuntu-latest

steps:
- run: sudo apt install pcregrep

- uses: actions/checkout@v4

- name: Parse changelog
id: parse-changelog
run: |
tag='${{ github.event.release.tag_name }}'
re_current_tag="## \[$tag\].*\n\n" # Match, but do not capture, current version tag, then...
re_changes_body='((.|\n)+?)' # capture everything including newlines...
re_previous_tag='## \[[0-9]+.[0-9]+.[0-9]+\]' # until previous version tag.
re_full="${re_current_tag}${re_changes_body}${re_previous_tag}"
echo 'match<<EOF' >> $GITHUB_OUTPUT
# Match multiple lines, output capture group 1.
pcregrep -M -o1 "$re_full" ./CHANGELOG.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT

- name: Set release body
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.parse-changelog.outputs.match }}

build:
uses: bessman/mcbootflash/.github/workflows/build.yml@actions/release

attach-artifacts:
needs: build

runs-on: ubuntu-latest

steps:
- name: download
uses: actions/download-artifact@v4

# Artifacts are tar'd to preserve permissions.
- name: untar
run: |
tar -xf linux/mcbootflash.tar -C linux
tar -xf macos/mcbootflash.tar -C macos
tar -xf windows/mcbootflash.tar -C windows

- name: zip
run: |
zip -rj linux.zip linux/dist/*
zip -rj macos.zip macos/dist/*
zip -rj windows.zip windows/dist/*

- name: attach
uses: softprops/action-gh-release@v2
with:
files: |
linux.zip
macos.zip
windows.zip
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## [10.0.1] - Development
## [10.1.0] - 2025-01-16

### Changed

- Workaround bootloader bug during erase ([`4203827`](https://github.com/bessman/mcbootflash/commit/420382732970a26dc6ed66bf9787c4c88f48f2f1))

### Added

- Add stand-alone executables in releases ([`26e4202`](https://github.com/bessman/mcbootflash/commit/26e420243d54a4b0c82ad802a1c9d68639633e60))

### Fixed

- Handle HEX-file not found error ([`94c76a6`](https://github.com/bessman/mcbootflash/commit/94c76a67e6fd883ff83f64771646c270d100feec))
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Mcbootflash is distributed under the MIT license.

## Installation

Stand-alone executables for Linux, Mac, and Windows are available from the Github
[release page](https://github.com/bessman/mcbootflash/releases/latest).

Mcbootflash can also be installed from PyPI:

`pip install mcbootflash`

## Usage
Expand Down
2 changes: 1 addition & 1 deletion src/mcbootflash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"write_flash",
]

__version__ = "10.0.1"
__version__ = "10.1.0"
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ commands = mkdocs build

[testenv:build]
deps = pyinstaller
commands = pyinstaller --noconfirm --name mcbootflash src/mcbootflash/__main__.py
commands = pyinstaller --onefile --noconfirm --name mcbootflash src/mcbootflash/__main__.py
Loading