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

Commit 9f27ae4

Browse files
chore: add package pipeline for 4 os optimize linux size
1 parent 7501109 commit 9f27ae4

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/python-package.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ jobs:
105105
$pythonFolder = Split-Path -Path "$pythonPath" -Parent
106106
echo "PYTHON_FOLDER=$pythonFolder" >> $env:GITHUB_ENV
107107
108-
Copy-Item -Path "$pythonFolder\python*.*" -Destination "$pythonFolder\Scripts\" -Force -Recurse
108+
Copy-Item -Path "$pythonFolder\python*.*" -Destination "$pythonFolder\Scripts\" -Force
109109
110-
- name: prepare python package unix
111-
if : runner.os != 'windows'
110+
- name: prepare python package macos
111+
if : runner.os == 'macOs'
112112
run: |
113113
source $HOME/miniconda/bin/activate base
114114
conda init
@@ -118,6 +118,18 @@ jobs:
118118
PYTHON_FOLDER=$(dirname $(dirname "$PYTHON_PATH"))
119119
echo "PYTHON_FOLDER=$PYTHON_FOLDER" >> $GITHUB_ENV
120120
echo "github end PYTHON_FOLDER: ${{env.PYTHON_FOLDER}}"
121+
- name: prepare python package linux
122+
if : runner.os == 'linux'
123+
run: |
124+
source $HOME/miniconda/bin/activate base
125+
conda init
126+
conda activate ${{env.MODEL_NAME}}
127+
PYTHON_PATH=$(which python)
128+
echo $PYTHON_PATH
129+
PYTHON_FOLDER=$(dirname $(dirname "$PYTHON_PATH"))
130+
rm -rf PYTHON_FOLDER/lib/python3.1
131+
echo "PYTHON_FOLDER=$PYTHON_FOLDER" >> $GITHUB_ENV
132+
echo "github end PYTHON_FOLDER: ${{env.PYTHON_FOLDER}}"
121133
122134
- name: Upload Artifact
123135
#if : runner.os == 'windows' || runner.os == 'linux'

0 commit comments

Comments
 (0)