Skip to content

Commit

Permalink
Merge pull request #308 from codecov/joseph/copy-metadata
Browse files Browse the repository at this point in the history
Update build_assets.yml
  • Loading branch information
giovanni-guidini authored Oct 18, 2023
2 parents 584c4ba + ad2654c commit 57fc07b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build_assets:
name: Build packages
name: Build packages - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand All @@ -21,11 +21,11 @@ jobs:
CFLAGS: -arch arm64 -arch x86_64
TARGET: macos
CMD_REQS: >
mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd ..
mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir --no-binary tree_sitter,ijson,charset_normalizer,PyYAML .. && cd .. &&
pip install --no-deps --no-index --find-links=pip-packages pip-packages/*
CMD_BUILD: >
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|^./||'") &&
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages --target-arch universal2 -F codecov_cli/main.py &&
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages --target-arch universal2 -F codecov_cli/main.py &&
mv dist/main dist/codecovcli_macos &&
lipo -archs dist/codecovcli_macos | grep 'x86_64 arm64'
OUT_FILE_NAME: codecovcli_macos
Expand All @@ -34,18 +34,20 @@ jobs:
TARGET: ubuntu
CMD_REQS: >
pip install -r requirements.txt
pip install .
CMD_BUILD: >
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|^./||'") &&
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py &&
pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py &&
cp ./dist/main ./dist/codecovcli_linux
OUT_FILE_NAME: codecovcli_linux
ASSET_MIME: application/octet-stream
- os: windows-latest
TARGET: windows
CMD_REQS: >
pip install -r requirements.txt
pip install .
CMD_BUILD: >
pyinstaller --add-binary "build\lib.win-amd64-cpython-311\staticcodecov_languages.cp311-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py &&
pyinstaller --add-binary "build\lib.win-amd64-cpython-311\staticcodecov_languages.cp311-win_amd64.pyd;." --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli\main.py &&
Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe"
OUT_FILE_NAME: codecovcli_windows.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ There are a few guidelines when developing in this system. Some notable folders:
2. `services` - It's where the heavy logic resides. It's mostly organized by which command needs them. Commands should generally be thin wrappers around these services.
3. `helpers` - This is meant for logic that is useful across different commands. For example, logging helpers, or the logic that searches folders.

## Dependencies

If external dependencies need to be added, it's important to check whether those dependencies have wheels available on PyPI with the `any` or `universal2` platform tags. If those dependencies don't have those wheels available, then they will need to built during the CI, so they will have to be added to the list of
dependencies in the `--no-binary` flag when building the requirements for the macos release in `build_assets.yml`.

# Releases

The standard way to making a new release is the following:
Expand Down

0 comments on commit 57fc07b

Please sign in to comment.