diff --git a/NEWS b/NEWS index 276ee159..b9d618a1 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ 2.1.4.dev0 + * #1266: Add a stand-alone borgmatic binary to the release downloads to serve as another way to + install borgmatic. Consider this binary a beta feature. * When Borg exits with a warning exit code, show a description of it, so you don't have to lookup the code. * Split out borgmatic installation documentation to its own page, so it's easier to find. diff --git a/binary_requirements.txt b/binary_requirements.txt new file mode 100644 index 00000000..3a08c369 --- /dev/null +++ b/binary_requirements.txt @@ -0,0 +1,19 @@ +. +apprise==1.9.8 +attrs==26.1.0 +certifi==2026.2.25 +charset-normalizer==3.4.6 +click==8.3.1 +idna==3.11 +jsonschema==4.26.0 +jsonschema-specifications==2025.9.1 +markdown==3.10.2 +oauthlib==3.3.1 +packaging==26.0 +pyyaml==6.0.3 +referencing==0.37.0 +requests==2.32.5 +requests-oauthlib==2.0.0 +rpds-py==0.30.0 +ruamel-yaml==0.19.1 +urllib3==2.6.3 diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index 267d23c1..f2cf8b7f 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -1202,3 +1202,7 @@ def main(extra_summary_logs=()): # pragma: no cover ) display_summary(summary_logs, log_json) + + +if __name__ == '__main__': # pragma: no cover + main() diff --git a/scripts/release b/scripts/release index 50f4a801..19b05ea4 100755 --- a/scripts/release +++ b/scripts/release @@ -43,6 +43,16 @@ twine upload -r pypi --username __token__ "$wheel_path" scripts/export-docs-from-image docs_path=dist/borgmatic-docs.tar.gz +# Build stand-alone binary. +uv venv --clear binary +source binary/bin/activate +uv pip install -r binary_requirements.txt +nuitka --show-modules --mode=onefile --enable-plugin=upx --include-package-data=borgmatic --include-data-dir=borgmatic.egg-info=borgmatic.egg-info --include-package=borgmatic.hooks --include-package=apprise --no-deployment-flag=self-execution borgmatic/commands/borgmatic.py +deactivate +rm -fr binary +standalone_binary_path=dist/borgmatic-${version}-linux-glibc-x86_64 +mv borgmatic.bin "$standalone_binary_path" + # Set release changelogs on projects.torsion.org and GitHub. release_changelog="$(cat NEWS | sed '/^$/q' | grep -v '^\S')" escaped_release_changelog="$(echo "$release_changelog" | sed -z 's/\n/\\n/g' | sed -z 's/\"/\\"/g')" @@ -68,6 +78,11 @@ curl --silent --request POST \ --header "Authorization: token $projects_token" \ --header "Accept: application/json" \ --form attachment=@"$docs_path" +curl --silent --request POST \ + "https://projects.torsion.org/api/v1/repos/borgmatic-collective/borgmatic/releases/$release_id/assets?name=$(basename $standalone_binary_path)" \ + --header "Authorization: token $projects_token" \ + --header "Accept: application/json" \ + --form attachment=@"$standalone_binary_path" github-release create --token="$github_token" --owner=witten --repo=borgmatic --tag="$version" --target_commit="main" \ --name="borgmatic $version" --body="$release_changelog"