mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
build: add build-borg-using-pyinstaller.sh and use it in ci.yml
This commit is contained in:
parent
6b93751a9a
commit
2768548032
2 changed files with 25 additions and 6 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
|
@ -299,8 +299,7 @@ jobs:
|
|||
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
|
||||
run: |
|
||||
pip install -r requirements.d/pyinstaller.txt
|
||||
mkdir -p dist/binary
|
||||
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
|
||||
./scripts/build-borg-using-pyinstaller.sh
|
||||
|
||||
- name: Smoke-test the built binary (${{ matrix.binary }})
|
||||
if: ${{ matrix.binary && startsWith(github.ref, 'refs/tags/') }}
|
||||
|
|
@ -471,8 +470,7 @@ jobs:
|
|||
|
||||
if [[ "${{ matrix.do_binaries }}" == "true" && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
|
||||
python -m pip install -r requirements.d/pyinstaller.txt
|
||||
mkdir -p dist/binary
|
||||
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
|
||||
./scripts/build-borg-using-pyinstaller.sh
|
||||
pushd dist/binary
|
||||
echo "single-file binary"
|
||||
chmod +x borg.exe
|
||||
|
|
@ -665,8 +663,7 @@ jobs:
|
|||
# build borg.exe
|
||||
. env/bin/activate
|
||||
pip install -e ".[cockpit,s3,sftp,rclone]"
|
||||
mkdir -p dist/binary
|
||||
pyinstaller -y --clean --distpath=dist/binary scripts/borg.exe.spec
|
||||
./scripts/build-borg-using-pyinstaller.sh
|
||||
# build sdist and wheel in dist/...
|
||||
python -m build
|
||||
|
||||
|
|
|
|||
22
scripts/build-borg-using-pyinstaller.sh
Executable file
22
scripts/build-borg-using-pyinstaller.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# Generate a single-file binary of borgbackup using PyInstaller.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
OUTPUT_DIR="dist/binary"
|
||||
SPEC_FILE="scripts/borg.exe.spec"
|
||||
|
||||
echo "Building single-file binary of borgbackup using PyInstaller..."
|
||||
|
||||
# Run PyInstaller compilation
|
||||
# We use -y/--noconfirm to overwrite the output directory without asking.
|
||||
# We use --clean to clean PyInstaller cache and temporary files before building.
|
||||
mkdir -p $OUTPUT_DIR
|
||||
pyinstaller \
|
||||
-y \
|
||||
--clean \
|
||||
--distpath="$OUTPUT_DIR" \
|
||||
"$SPEC_FILE"
|
||||
|
||||
echo "Single-file binary generated at:"
|
||||
echo "$OUTPUT_DIR/borg.exe"
|
||||
Loading…
Reference in a new issue