Skip to content

Commit

Permalink
clean up pyc
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Nov 29, 2023
1 parent 568fc81 commit 69d63a8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/build_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ jobs:
options: -v ${{ github.workspace }}:/work --workdir /tmp --platform ${{ steps.parse_platform.outputs.platform }}
run: |
set -e
export PYTHONDONTWRITEBYTECODE=1
/work/scripts/build_linux.sh ${{ matrix.arch }} ${{ inputs.python_version }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: python
path: ./*python*.tar.gz
path: ./python*.tar.gz

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: build-python
path: ./build-python*.tar.gz

- name: Test python in clean environment
if: false
Expand Down Expand Up @@ -100,14 +105,20 @@ jobs:
shell: bash
run: |
set -ex
export PYTHONDONTWRITEBYTECODE=1
./scripts/build_windows.sh x86_64 ${{ inputs.python_version }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: python
path: ./*python*.tar.gz
path: ./python*.tar.gz

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: build-python
path: ./build-python*.tar.gz

test_windows:
name: Windows ${{ inputs.python_version }} x86_64 (test)
Expand Down Expand Up @@ -144,14 +155,20 @@ jobs:
- name: Build
run: |
set -ex
export PYTHONDONTWRITEBYTECODE=1
./scripts/build_macos.sh universal2 ${{ inputs.python_version }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: python
path: ./*python*.tar.gz
path: ./python*.tar.gz

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: build-python
path: ./build-python*.tar.gz

test_macos:
name: MacOS ${{ inputs.python_version }} universal2 (test)
Expand Down
2 changes: 2 additions & 0 deletions scripts/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ echo "::endgroup::"
echo "::group::Compress output"

cd ..
python3 -m pip install pyclean
python3 -m pyclean -v python-install
mv python-install python-${PYTHON_FULL_VER}-linux-${ARCH}
tar -czf /work/python-${PYTHON_FULL_VER}-linux-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-linux-${ARCH}

Expand Down
2 changes: 2 additions & 0 deletions scripts/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ cd ${WORKDIR}
cd python-build
tar -czf ../build-python-${PYTHON_FULL_VER}-darwin-${ARCH}.tar.gz .
cd ${WORKDIR}
python3 -m pip install pyclean
python3 -m pyclean -v python-install
mv python-install python-${PYTHON_FULL_VER}-darwin-${ARCH}
tar -czf python-${PYTHON_FULL_VER}-darwin-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-darwin-${ARCH}

Expand Down
2 changes: 2 additions & 0 deletions scripts/build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ cd ${WORKDIR}
cd python-build
tar -czf ../build-python-${PYTHON_FULL_VER}-windows-${ARCH}.tar.gz .
cd ${WORKDIR}
python3 -m pip install pyclean
python3 -m pyclean -v python-install
mv python-install python-${PYTHON_FULL_VER}-windows-${ARCH}
tar -czf python-${PYTHON_FULL_VER}-windows-${ARCH}.tar.gz python-${PYTHON_FULL_VER}-windows-${ARCH}

Expand Down

0 comments on commit 69d63a8

Please sign in to comment.