Skip to content

Commit

Permalink
Fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
trent-codecov committed Oct 5, 2023
1 parent 83240ec commit db7a1c7
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 72 deletions.
141 changes: 71 additions & 70 deletions .github/workflows/build_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,77 @@ on:
description: "Attach artifacts to a release"

jobs:
name: Build packages
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: macos-latest
env:
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 ..
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 -F codecov_cli/main.py &&
mv dist/main dist/codecovcli_macos &&
lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1
OUT_FILE_NAME: codecovcli_macos
ASSET_MIME: application/octet-stream
- os: ubuntu-20.04
TARGET: ubuntu
CMD_REQS: >
pip install -r requirements.txt
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 &&
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
CMD_BUILD: >
pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --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
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
${{matrix.CMD_REQS}}
python setup.py build
- name: Install pyinstaller
run: pip install pyinstaller
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
if: inputs.release == false
with:
path: ./dist/${{ matrix.OUT_FILE_NAME }}
- name: Upload Release Asset
if: inputs.release == true
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/${{ matrix.OUT_FILE_NAME }}
asset_name: ${{ matrix.OUT_FILE_NAME }}
tag: ${{ github.ref }}
overwrite: true
build_assets:
name: Build packages
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: macos-latest
env:
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 ..
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 -F codecov_cli/main.py &&
mv dist/main dist/codecovcli_macos &&
lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1
OUT_FILE_NAME: codecovcli_macos
ASSET_MIME: application/octet-stream
- os: ubuntu-20.04
TARGET: ubuntu
CMD_REQS: >
pip install -r requirements.txt
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 &&
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
CMD_BUILD: >
pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --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
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
${{matrix.CMD_REQS}}
python setup.py build
- name: Install pyinstaller
run: pip install pyinstaller
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
if: inputs.release == false
with:
path: ./dist/${{ matrix.OUT_FILE_NAME }}
- name: Upload Release Asset
if: inputs.release == true
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/${{ matrix.OUT_FILE_NAME }}
asset_name: ${{ matrix.OUT_FILE_NAME }}
tag: ${{ github.ref }}
overwrite: true



2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
create-release:
name: Tag Release ${{ github.head_ref }}
if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') && github.repository_owner == 'codecov' }}
uses: codecov/gha-workflows/.github/workflows/create-release.yml@v1.2.1
uses: codecov/gha-workflows/.github/workflows/create-release.yml@v1.2.2
secrets: inherit

release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:
jobs:
create-release-pr:
name: Create PR for Release ${{ github.event.inputs.versionName }}
uses: codecov/gha-workflows/.github/workflows/create-release-pr.yml@v1.2.1
uses: codecov/gha-workflows/.github/workflows/create-release-pr.yml@v1.2.2
secrets: inherit

0 comments on commit db7a1c7

Please sign in to comment.