Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxinglei committed May 30, 2024
1 parent 566ef2d commit 90c834c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
runs-on: ubuntu-latest
env:
NEED_ACTIVATE_ENV: "false"
DEBUG: "true"
steps:
- name: checkout repository
uses: actions/checkout@v4
Expand All @@ -29,14 +28,15 @@ jobs:
post-cleanup: 'none'
- name: Run custom command in micromamba environment
run: |
du -sh /home/runner/.cache
./manager build
echo "build finish"
rm -rf /home/runner/.cache/bazel
./manager copy-libs
rm -rf /home/runner/.cache/bazel # remove bazel cache to avoid job hang
shell: micromamba-shell {0}

- name: Create setup dist
run: ./manager create_dist
run: |
./manager create_dist
twine check
shell: micromamba-shell {0}

- name: Store wheels
Expand All @@ -56,6 +56,7 @@ jobs:
- name: Download wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish wheels to test-PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -74,6 +75,7 @@ jobs:
- name: Download wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
8 changes: 3 additions & 5 deletions manager
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ start_build(){
[[ ${NEED_ACTIVATE_ENV} == true ]] && _activate_env
_build_config
extra_opts=("$@")
# [[ ${DEBUG-} != true ]] || extra_opts+=(--sandbox_debug)
bazel clean --expunge
bazel build --spawn_strategy=standalone "${extra_opts[@]}" -c opt //core:_pywrap_tn.so
start_copy_libs
[[ ${DEBUG-} != true ]] || extra_opts+=(--sandbox_debug)
bazel build "${extra_opts[@]}" -c opt //core:_pywrap_tn.so
}

only_build(){
Expand Down Expand Up @@ -106,13 +104,13 @@ start_create_dist(){
[[ ${NEED_PREPARE_ENV} == true ]] && _prepare_mamba_env
[[ ${NEED_ACTIVATE_ENV} == true ]] && _activate_env
rm -rf dist/* || true
#start_copy_libs
[[ $# > 0 ]] && export TN_VERSION=$1
PY_VERSION=$(python -c "import sys; print('cp' + ''.join(map(str, sys.version_info[:2])))")
python setup.py bdist_wheel --plat-name manylinux2010_x86_64 --python-tag ${PY_VERSION}
}

start_upload(){
start_copy_libs
start_create_dist
start_only_upload
}
Expand Down

0 comments on commit 90c834c

Please sign in to comment.