Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 40483bb

Browse files
Merge pull request #269 from codecov/joseph/universal2-gha
Build macos cli executable using universal2 python
2 parents ccba317 + d994ebf commit 40483bb

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/release_flow.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- uses: actions/checkout@v3
1818
with:
1919
submodules: true
20-
- name: Set up Python 3.10
20+
- name: Set up Python 3.11
2121
uses: actions/setup-python@v4
2222
with:
23-
python-version: "3.10"
23+
python-version: "3.11"
2424
- name: Install dependencies
2525
run: |
2626
pip install -r requirements.txt
@@ -43,15 +43,23 @@ jobs:
4343
matrix:
4444
include:
4545
- os: macos-latest
46+
env:
47+
CFLAGS: '-arch arm64 -arch x86_64'
4648
TARGET: macos
49+
CMD_REQS: >
50+
mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd ..
51+
pip install --no-deps --no-index --find-links=pip-packages pip-packages/*
4752
CMD_BUILD: >
4853
STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") &&
4954
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py &&
50-
mv dist/main dist/codecovcli_macos
55+
mv dist/main dist/codecovcli_macos &&
56+
lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1
5157
OUT_FILE_NAME: codecovcli_macos
5258
ASSET_MIME: application/octet-stream
5359
- os: ubuntu-latest
5460
TARGET: ubuntu
61+
CMD_REQS: >
62+
pip install -r requirements.txt
5563
CMD_BUILD: >
5664
STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") &&
5765
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py &&
@@ -60,6 +68,8 @@ jobs:
6068
ASSET_MIME: application/octet-stream
6169
- os: windows-latest
6270
TARGET: windows
71+
CMD_REQS: >
72+
pip install -r requirements.txt
6373
CMD_BUILD: >
6474
pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py &&
6575
Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe"
@@ -69,13 +79,13 @@ jobs:
6979
- uses: actions/checkout@v3
7080
with:
7181
submodules: true
72-
- name: Set up Python 3.10
82+
- name: Set up Python 3.11
7383
uses: actions/setup-python@v3
7484
with:
75-
python-version: "3.10"
85+
python-version: "3.11"
7686
- name: Install dependencies
7787
run: |
78-
pip install -r requirements.txt
88+
${{matrix.CMD_REQS}}
7989
python setup.py build
8090
- name: Install pyinstaller
8191
run: pip install pyinstaller

0 commit comments

Comments
 (0)