Skip to content

Commit ed669b3

Browse files
committed
Publish Linux ARM binaries
1 parent ffe635b commit ed669b3

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

.github/workflows/cd.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ jobs:
2222
steps:
2323
- name: Determine if pre-release
2424
id: prerelease_check
25+
# it checks for PEP 440 compatible prerelease tags
2526
run: |
26-
export IS_PRERELEASE=$([[ ${{ github.ref }} =~ [^0-9]$ ]] && echo true || echo false)
27+
export IS_PRERELEASE=$([[ ${{ github.ref }} =~ [abrcdev]+[0-9]+$ ]] && echo true || echo false)
2728
echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
2829
export PUBLISH_DOCKER=$([[ $IS_PRERELEASE == 'false' && "${{ secrets.DOCKERHUB_USERNAME }}" != '' ]] && echo true || echo false)
2930
echo "publish_docker=$PUBLISH_DOCKER" >> $GITHUB_OUTPUT
@@ -61,19 +62,22 @@ jobs:
6162
password: ${{ secrets.B2_PYPI_PASSWORD }}
6263
deploy-linux-bundle:
6364
needs: deploy
64-
runs-on: ubuntu-latest
65-
container:
66-
image: "python:3.12" # can not use ${{ env.PYTHON_DEFAULT_VERSION }} here
67-
env:
68-
DEBIAN_FRONTEND: noninteractive
65+
strategy:
66+
matrix:
67+
os: [ "ubuntu-22.04", "ubuntu-22.04-arm" ]
68+
runs-on: ${{ matrix.os }}
6969
steps:
7070
- uses: actions/checkout@v4
7171
with:
7272
fetch-depth: 0
73+
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (deadsnakes)
74+
uses: deadsnakes/[email protected] # staticx doesn't work with python installed by setup-python action
75+
with:
76+
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
7377
- name: Install dependencies
7478
run: |
7579
apt-get -y update
76-
apt-get -y install patchelf
80+
apt-get -y install patchelf scons
7781
python -m pip install --upgrade nox pdm
7882
git config --global --add safe.directory '*'
7983
- name: Bundle the distribution

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ upcoming release can be found in [changelog.d](changelog.d).
99

1010
<!-- towncrier release notes start -->
1111

12+
## [4.5.0dev0](https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v4.5.0dev0) - 2025-07-31
13+
14+
15+
### Added
16+
17+
- Test release
18+
19+
1220
## [4.4.1](https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v4.4.1) - 2025-07-30
1321

1422

noxfile.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def _detect_python_nox_id() -> str:
6868
DOCKER_TEMPLATE = pathlib.Path('docker/Dockerfile.template')
6969

7070
SYSTEM = platform.system().lower()
71+
MACHINE = platform.machine().lower()
7172

7273
WINDOWS_TIMESTAMP_SERVER = 'http://timestamp.digicert.com'
7374
WINDOWS_SIGNTOOL_PATH = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe'
@@ -139,6 +140,18 @@ def get_versions() -> list[str]:
139140
]
140141

141142

143+
def is_x86_64_architecture():
144+
"""
145+
Determines if the machine's architecture is x86-based.
146+
147+
This function checks the current machine's architecture and returns
148+
whether it belongs to the x86 64-bit family (including x86_64 or amd64).
149+
"""
150+
if MACHINE in ("x86_64", "amd64"):
151+
return True
152+
return False
153+
154+
142155
@nox.session(name='format', python=PYTHON_DEFAULT_VERSION)
143156
def format_(session):
144157
"""Lint the code and apply fixes in-place whenever possible."""
@@ -405,11 +418,15 @@ def sign_windows(keypair_alias, cert_fingerprint):
405418
else:
406419
session.error(f'unrecognized platform: {SYSTEM}')
407420

408-
# Append OS name to all the binaries.
421+
# Append OS name and optionally an architecture to all the binaries.
409422
for asset in pathlib.Path('dist').glob('*'):
410423
name = asset.stem
411424
ext = asset.suffix
412-
asset_path = f'dist/{name}-{SYSTEM}{ext}'
425+
if is_x86_64_architecture():
426+
asset_path = f'dist/{name}-{SYSTEM}{ext}'
427+
else:
428+
asset_path = f'dist/{name}-{SYSTEM}-{MACHINE}{ext}'
429+
413430
session.run('mv', '-f', asset, asset_path, external=True)
414431

415432
# Path have to be specified with unix style slashes even for windows,

0 commit comments

Comments
 (0)