Package and Release Conda Environment #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package and Release Conda Environment | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' # 例如,v1.0, v2.0 等 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出存储库 | |
uses: actions/checkout@v4 # 使用最新的v4版本 | |
- name: 安装 Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Miniforge | |
python-version: '3.10.8' | |
installer-url: "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" | |
- name: 清理 Docker 和 Conda 缓存 | |
run: | | |
docker system prune -af || true | |
conda clean -a -y | |
- name: 设置并安装依赖 | |
run: | | |
conda create --name VisRAG python=3.10.8 -y | |
conda init bash | |
source ~/.bashrc | |
conda activate VisRAG | |
conda install -c nvidia/label/cuda-11.8.0 cuda-toolkit -y | |
conda install -c conda-forge conda-pack -y | |
pip install -r requirements.txt | |
pip install . | |
cd timm_modified | |
pip install . | |
cd .. | |
- name: 打包 Conda 环境 | |
run: | | |
conda run -n VisRAG conda pack -n VisRAG -o VisRAG_env.tar.gz | |
- name: 上传环境到 GitHub Release | |
uses: softprops/action-gh-release@v2 # 使用有效的发布 Action 版本 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: VisRAG Environment for ${{ github.ref_name }} | |
body: "Conda environment package for version ${{ github.ref_name }}" | |
files: VisRAG_env.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |