Skip to content

Commit

Permalink
Adding arch script to reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgriffith committed Aug 7, 2024
1 parent f935840 commit 16cb1f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
mkdir dist
echo "::set-env name=VERSION::$(python scripts/get_version.py)"
echo "::set-env name=ARCH::$(python -c 'import platform; print(\"arm64\" if \"arm64\" in platform.platform() else \"x86_64\")')"
echo "::set-env name=ARCH::$(python scripts/get_arch.py)"
echo "Building branch ${{env.GITHUB_REF}} - version ${{env.VERSION}} - on ${{env.ARCH}}"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand Down
13 changes: 13 additions & 0 deletions scripts/get_arch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import platform


def write_and_exit(msg):
sys.stdout.write(msg)
sys.stdout.flush()
sys.exit(0)


write_and_exit("arm64" if "arm64" in platform.platform() else "x86_64")

0 comments on commit 16cb1f1

Please sign in to comment.