From 8f643de8dfd7b5ec2e54cd025d09f5f819700ad6 Mon Sep 17 00:00:00 2001 From: Menghuan Date: Thu, 5 Dec 2024 22:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8=E6=89=93?= =?UTF-8?q?=E5=8C=85windows=E4=B8=8B=E7=9A=84=E7=8E=AF=E5=A2=83=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/conda-pack-windows.yml | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/conda-pack-windows.yml diff --git a/.github/workflows/conda-pack-windows.yml b/.github/workflows/conda-pack-windows.yml new file mode 100644 index 00000000..419b495c --- /dev/null +++ b/.github/workflows/conda-pack-windows.yml @@ -0,0 +1,59 @@ +name: Create Conda Environment Package + +on: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + auto-activate-base: true + activate-environment: "" + + - name: Create new Conda environment + shell: bash -l {0} + run: | + conda create -n gpt python=3.11 -y + conda activate gpt + + - name: Copy files (excluding .git) + shell: bash -l {0} + run: | + mkdir temp_workspace + cp -r * temp_workspace/ 2>/dev/null || : + rm -rf temp_workspace/.git* || : + + - name: Install requirements + shell: bash -l {0} + run: | + conda activate gpt + pip install -r requirements.txt + + - name: Install conda-pack + shell: bash -l {0} + run: | + conda activate gpt + conda install conda-pack -y + + - name: Pack workspace and environment + shell: bash -l {0} + run: | + conda activate gpt + conda pack -n gpt -o gpt.tar.gz + cd temp_workspace + tar -czf ../workspace.tar.gz * + + - name: Upload packed files + uses: actions/upload-artifact@v2 + with: + name: gpt-academic-package + path: | + gpt.tar.gz + workspace.tar.gz