新增自动打包windows下的环境依赖

This commit is contained in:
Menghuan 2024-12-05 22:11:42 +08:00
parent eee8115434
commit 8f643de8df
1 changed files with 59 additions and 0 deletions

View File

@ -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