mirror of
https://github.com/deepmodeling/Uni-Lab-OS
synced 2026-05-24 21:26:27 +00:00
fix pack install 2
This commit is contained in:
2
.github/workflows/ci-check.yml
vendored
2
.github/workflows/ci-check.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
- name: Install ROS dependencies, uv and unilabos-msgs
|
- name: Install ROS dependencies, uv and unilabos-msgs
|
||||||
run: |
|
run: |
|
||||||
echo Installing ROS dependencies...
|
echo Installing ROS dependencies...
|
||||||
mamba install -n check-env conda-forge::uv conda-forge::opencv robostack-staging::ros-humble-ros-core robostack-staging::ros-humble-action-msgs robostack-staging::ros-humble-std-msgs robostack-staging::ros-humble-geometry-msgs robostack-staging::ros-humble-control-msgs robostack-staging::ros-humble-nav2-msgs uni-lab::ros-humble-unilabos-msgs robostack-staging::ros-humble-cv-bridge robostack-staging::ros-humble-vision-opencv robostack-staging::ros-humble-tf-transformations robostack-staging::ros-humble-moveit-msgs robostack-staging::ros-humble-tf2-ros robostack-staging::ros-humble-tf2-ros-py conda-forge::transforms3d -c robostack-staging -c conda-forge -c uni-lab -y
|
mamba install -n check-env --override-channels -c robostack-staging -c conda-forge -c uni-lab conda-forge::uv conda-forge::opencv robostack-staging::ros-humble-ros-core robostack-staging::ros-humble-action-msgs robostack-staging::ros-humble-std-msgs robostack-staging::ros-humble-geometry-msgs robostack-staging::ros-humble-control-msgs robostack-staging::ros-humble-nav2-msgs uni-lab::ros-humble-unilabos-msgs robostack-staging::ros-humble-cv-bridge robostack-staging::ros-humble-vision-opencv robostack-staging::ros-humble-tf-transformations robostack-staging::ros-humble-moveit-msgs robostack-staging::ros-humble-tf2-ros robostack-staging::ros-humble-tf2-ros-py conda-forge::transforms3d -y
|
||||||
|
|
||||||
- name: Install pip dependencies and unilabos
|
- name: Install pip dependencies and unilabos
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
68
.github/workflows/conda-pack-build.yml
vendored
68
.github/workflows/conda-pack-build.yml
vendored
@@ -1,6 +1,10 @@
|
|||||||
name: Build Conda-Pack Environment
|
name: Build Conda-Pack Environment
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
# 在 UniLabOS Conda Build 成功上传后自动构建非全量 conda-pack
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["UniLabOS Conda Build"]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
branch:
|
branch:
|
||||||
@@ -21,6 +25,16 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-conda-pack:
|
build-conda-pack:
|
||||||
|
if: |
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
(
|
||||||
|
github.event_name == 'workflow_run' &&
|
||||||
|
github.event.workflow_run.conclusion == 'success' &&
|
||||||
|
github.event.workflow_run.event == 'workflow_run'
|
||||||
|
)
|
||||||
|
env:
|
||||||
|
BUILD_FULL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build_full == 'true' }}
|
||||||
|
PACKAGE_REF: ${{ github.event.inputs.branch || github.event.workflow_run.head_sha || github.ref_name }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -54,7 +68,9 @@ jobs:
|
|||||||
id: should_build
|
id: should_build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ -z "${{ github.event.inputs.platforms }}" ]]; then
|
if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then
|
||||||
|
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ -z "${{ github.event.inputs.platforms }}" ]]; then
|
||||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||||
elif [[ "${{ github.event.inputs.platforms }}" == *"${{ matrix.platform }}"* ]]; then
|
elif [[ "${{ github.event.inputs.platforms }}" == *"${{ matrix.platform }}"* ]]; then
|
||||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||||
@@ -65,7 +81,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.branch }}
|
ref: ${{ github.event.inputs.branch || github.event.workflow_run.head_sha || github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Miniforge (with mamba)
|
- name: Setup Miniforge (with mamba)
|
||||||
@@ -75,7 +91,7 @@ jobs:
|
|||||||
miniforge-version: latest
|
miniforge-version: latest
|
||||||
use-mamba: true
|
use-mamba: true
|
||||||
python-version: '3.11.14'
|
python-version: '3.11.14'
|
||||||
channels: conda-forge,robostack-staging,uni-lab,defaults
|
channels: conda-forge,robostack-staging,uni-lab
|
||||||
channel-priority: flexible
|
channel-priority: flexible
|
||||||
activate-environment: unilab
|
activate-environment: unilab
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
@@ -86,13 +102,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo Installing unilabos and dependencies to unilab environment...
|
echo Installing unilabos and dependencies to unilab environment...
|
||||||
echo Using mamba for faster and more reliable dependency resolution...
|
echo Using mamba for faster and more reliable dependency resolution...
|
||||||
echo Build full: ${{ github.event.inputs.build_full }}
|
echo Build full: ${{ env.BUILD_FULL }}
|
||||||
if "${{ github.event.inputs.build_full }}"=="true" (
|
if "${{ env.BUILD_FULL }}"=="true" (
|
||||||
echo Installing unilabos-full ^(complete package^)...
|
echo Installing unilabos-full ^(complete package^)...
|
||||||
mamba install -n unilab uni-lab::unilabos-full conda-pack zstandard -c uni-lab -c robostack-staging -c conda-forge -y
|
mamba install -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge uni-lab::unilabos-full conda-pack zstandard -y
|
||||||
) else (
|
) else (
|
||||||
echo Installing unilabos ^(minimal package^)...
|
echo Installing unilabos ^(minimal package^)...
|
||||||
mamba install -n unilab uni-lab::unilabos conda-pack zstandard -c uni-lab -c robostack-staging -c conda-forge -y
|
mamba install -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge uni-lab::unilabos conda-pack zstandard -y
|
||||||
)
|
)
|
||||||
|
|
||||||
- name: Install conda-pack, unilabos and dependencies (Unix)
|
- name: Install conda-pack, unilabos and dependencies (Unix)
|
||||||
@@ -101,13 +117,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Installing unilabos and dependencies to unilab environment..."
|
echo "Installing unilabos and dependencies to unilab environment..."
|
||||||
echo "Using mamba for faster and more reliable dependency resolution..."
|
echo "Using mamba for faster and more reliable dependency resolution..."
|
||||||
echo "Build full: ${{ github.event.inputs.build_full }}"
|
echo "Build full: ${{ env.BUILD_FULL }}"
|
||||||
if [[ "${{ github.event.inputs.build_full }}" == "true" ]]; then
|
if [[ "${{ env.BUILD_FULL }}" == "true" ]]; then
|
||||||
echo "Installing unilabos-full (complete package)..."
|
echo "Installing unilabos-full (complete package)..."
|
||||||
mamba install -n unilab uni-lab::unilabos-full conda-pack zstandard -c uni-lab -c robostack-staging -c conda-forge -y
|
mamba install -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge uni-lab::unilabos-full conda-pack zstandard -y
|
||||||
else
|
else
|
||||||
echo "Installing unilabos (minimal package)..."
|
echo "Installing unilabos (minimal package)..."
|
||||||
mamba install -n unilab uni-lab::unilabos conda-pack zstandard -c uni-lab -c robostack-staging -c conda-forge -y
|
mamba install -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge uni-lab::unilabos conda-pack zstandard -y
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Get latest ros-humble-unilabos-msgs version (Windows)
|
- name: Get latest ros-humble-unilabos-msgs version (Windows)
|
||||||
@@ -134,27 +150,27 @@ jobs:
|
|||||||
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
|
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
|
||||||
run: |
|
run: |
|
||||||
echo Checking for available ros-humble-unilabos-msgs versions...
|
echo Checking for available ros-humble-unilabos-msgs versions...
|
||||||
mamba search ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge || echo Search completed
|
mamba search --override-channels -c uni-lab -c robostack-staging -c conda-forge ros-humble-unilabos-msgs || echo Search completed
|
||||||
echo.
|
echo.
|
||||||
echo Updating ros-humble-unilabos-msgs to latest version...
|
echo Updating ros-humble-unilabos-msgs to latest version...
|
||||||
mamba update -n unilab ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo Already at latest version
|
mamba update -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge ros-humble-unilabos-msgs -y || echo Already at latest version
|
||||||
|
|
||||||
- name: Check for newer ros-humble-unilabos-msgs (Unix)
|
- name: Check for newer ros-humble-unilabos-msgs (Unix)
|
||||||
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
|
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for available ros-humble-unilabos-msgs versions..."
|
echo "Checking for available ros-humble-unilabos-msgs versions..."
|
||||||
mamba search ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge || echo "Search completed"
|
mamba search --override-channels -c uni-lab -c robostack-staging -c conda-forge ros-humble-unilabos-msgs || echo "Search completed"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Updating ros-humble-unilabos-msgs to latest version..."
|
echo "Updating ros-humble-unilabos-msgs to latest version..."
|
||||||
mamba update -n unilab ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo "Already at latest version"
|
mamba update -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge ros-humble-unilabos-msgs -y || echo "Already at latest version"
|
||||||
|
|
||||||
- name: Install latest unilabos from source (Windows)
|
- name: Install latest unilabos from source (Windows)
|
||||||
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
|
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
|
||||||
run: |
|
run: |
|
||||||
echo Uninstalling existing unilabos...
|
echo Uninstalling existing unilabos...
|
||||||
mamba run -n unilab pip uninstall unilabos -y || echo unilabos not installed via pip
|
mamba run -n unilab pip uninstall unilabos -y || echo unilabos not installed via pip
|
||||||
echo Installing unilabos from source (branch: ${{ github.event.inputs.branch }})...
|
echo Installing unilabos from source (ref: ${{ env.PACKAGE_REF }})...
|
||||||
mamba run -n unilab pip install .
|
mamba run -n unilab pip install .
|
||||||
echo Verifying installation...
|
echo Verifying installation...
|
||||||
mamba run -n unilab pip show unilabos
|
mamba run -n unilab pip show unilabos
|
||||||
@@ -165,7 +181,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Uninstalling existing unilabos..."
|
echo "Uninstalling existing unilabos..."
|
||||||
mamba run -n unilab pip uninstall unilabos -y || echo "unilabos not installed via pip"
|
mamba run -n unilab pip uninstall unilabos -y || echo "unilabos not installed via pip"
|
||||||
echo "Installing unilabos from source (branch: ${{ github.event.inputs.branch }})..."
|
echo "Installing unilabos from source (ref: ${{ env.PACKAGE_REF }})..."
|
||||||
mamba run -n unilab pip install .
|
mamba run -n unilab pip install .
|
||||||
echo "Verifying installation..."
|
echo "Verifying installation..."
|
||||||
mamba run -n unilab pip show unilabos
|
mamba run -n unilab pip show unilabos
|
||||||
@@ -270,7 +286,7 @@ jobs:
|
|||||||
|
|
||||||
rem Create README using Python script
|
rem Create README using Python script
|
||||||
echo Creating: README.txt
|
echo Creating: README.txt
|
||||||
python scripts\create_readme.py ${{ matrix.platform }} ${{ github.event.inputs.branch }} dist-package\README.txt
|
python scripts\create_readme.py ${{ matrix.platform }} ${{ env.PACKAGE_REF }} dist-package\README.txt
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Distribution package contents:
|
echo Distribution package contents:
|
||||||
@@ -306,7 +322,7 @@ jobs:
|
|||||||
|
|
||||||
# Create README using Python script
|
# Create README using Python script
|
||||||
echo "Creating: README.txt"
|
echo "Creating: README.txt"
|
||||||
python scripts/create_readme.py ${{ matrix.platform }} ${{ github.event.inputs.branch }} dist-package/README.txt
|
python scripts/create_readme.py ${{ matrix.platform }} ${{ env.PACKAGE_REF }} dist-package/README.txt
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Distribution package contents:"
|
echo "Distribution package contents:"
|
||||||
@@ -317,7 +333,7 @@ jobs:
|
|||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: unilab-pack-${{ matrix.platform }}-${{ github.event.inputs.branch }}
|
name: unilab-pack-${{ matrix.platform }}-${{ env.PACKAGE_REF }}
|
||||||
path: dist-package/
|
path: dist-package/
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
@@ -329,9 +345,9 @@ jobs:
|
|||||||
echo Build Summary
|
echo Build Summary
|
||||||
echo ==========================================
|
echo ==========================================
|
||||||
echo Platform: ${{ matrix.platform }}
|
echo Platform: ${{ matrix.platform }}
|
||||||
echo Branch: ${{ github.event.inputs.branch }}
|
echo Branch: ${{ env.PACKAGE_REF }}
|
||||||
echo Python version: 3.11.14
|
echo Python version: 3.11.14
|
||||||
if "${{ github.event.inputs.build_full }}"=="true" (
|
if "${{ env.BUILD_FULL }}"=="true" (
|
||||||
echo Package: unilabos-full ^(complete^)
|
echo Package: unilabos-full ^(complete^)
|
||||||
) else (
|
) else (
|
||||||
echo Package: unilabos ^(minimal^)
|
echo Package: unilabos ^(minimal^)
|
||||||
@@ -340,7 +356,7 @@ jobs:
|
|||||||
echo Distribution package contents:
|
echo Distribution package contents:
|
||||||
dir dist-package
|
dir dist-package
|
||||||
echo.
|
echo.
|
||||||
echo Artifact name: unilab-pack-${{ matrix.platform }}-${{ github.event.inputs.branch }}
|
echo Artifact name: unilab-pack-${{ matrix.platform }}-${{ env.PACKAGE_REF }}
|
||||||
echo.
|
echo.
|
||||||
echo After download, extract the ZIP and run:
|
echo After download, extract the ZIP and run:
|
||||||
echo install_unilab.bat
|
echo install_unilab.bat
|
||||||
@@ -354,9 +370,9 @@ jobs:
|
|||||||
echo "Build Summary"
|
echo "Build Summary"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Platform: ${{ matrix.platform }}"
|
echo "Platform: ${{ matrix.platform }}"
|
||||||
echo "Branch: ${{ github.event.inputs.branch }}"
|
echo "Branch: ${{ env.PACKAGE_REF }}"
|
||||||
echo "Python version: 3.11.14"
|
echo "Python version: 3.11.14"
|
||||||
if [[ "${{ github.event.inputs.build_full }}" == "true" ]]; then
|
if [[ "${{ env.BUILD_FULL }}" == "true" ]]; then
|
||||||
echo "Package: unilabos-full (complete)"
|
echo "Package: unilabos-full (complete)"
|
||||||
else
|
else
|
||||||
echo "Package: unilabos (minimal)"
|
echo "Package: unilabos (minimal)"
|
||||||
@@ -365,7 +381,7 @@ jobs:
|
|||||||
echo "Distribution package contents:"
|
echo "Distribution package contents:"
|
||||||
ls -lh dist-package/
|
ls -lh dist-package/
|
||||||
echo ""
|
echo ""
|
||||||
echo "Artifact name: unilab-pack-${{ matrix.platform }}-${{ github.event.inputs.branch }}"
|
echo "Artifact name: unilab-pack-${{ matrix.platform }}-${{ env.PACKAGE_REF }}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "After download:"
|
echo "After download:"
|
||||||
echo " install_unilab.sh"
|
echo " install_unilab.sh"
|
||||||
|
|||||||
4
.github/workflows/deploy-docs.yml
vendored
4
.github/workflows/deploy-docs.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
|||||||
miniforge-version: latest
|
miniforge-version: latest
|
||||||
use-mamba: true
|
use-mamba: true
|
||||||
python-version: '3.11.14'
|
python-version: '3.11.14'
|
||||||
channels: conda-forge,robostack-staging,uni-lab,defaults
|
channels: conda-forge,robostack-staging,uni-lab
|
||||||
channel-priority: flexible
|
channel-priority: flexible
|
||||||
activate-environment: unilab
|
activate-environment: unilab
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
@@ -66,7 +66,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Installing unilabos and dependencies to unilab environment..."
|
echo "Installing unilabos and dependencies to unilab environment..."
|
||||||
echo "Using mamba for faster and more reliable dependency resolution..."
|
echo "Using mamba for faster and more reliable dependency resolution..."
|
||||||
mamba install -n unilab uni-lab::unilabos -c uni-lab -c robostack-staging -c conda-forge -y
|
mamba install -n unilab --override-channels -c uni-lab -c robostack-staging -c conda-forge uni-lab::unilabos -y
|
||||||
|
|
||||||
- name: Install latest unilabos from source
|
- name: Install latest unilabos from source
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
22
.github/workflows/multi-platform-build.yml
vendored
22
.github/workflows/multi-platform-build.yml
vendored
@@ -10,6 +10,9 @@ on:
|
|||||||
# 支持 tag 推送(不依赖 CI Check)
|
# 支持 tag 推送(不依赖 CI Check)
|
||||||
push:
|
push:
|
||||||
tags: ['v*']
|
tags: ['v*']
|
||||||
|
# GitHub Release 发布时自动构建并上传
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
# 手动触发
|
# 手动触发
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -80,7 +83,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
# 如果是 workflow_run 触发,使用触发 CI Check 的 commit
|
# 如果是 workflow_run 触发,使用触发 CI Check 的 commit
|
||||||
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
|
ref: ${{ github.event.workflow_run.head_sha || github.event.release.tag_name || github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Check if platform should be built
|
- name: Check if platform should be built
|
||||||
@@ -96,12 +99,13 @@ jobs:
|
|||||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Setup Miniconda
|
- name: Setup Miniforge
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
uses: conda-incubator/setup-miniconda@v3
|
uses: conda-incubator/setup-miniconda@v3
|
||||||
with:
|
with:
|
||||||
miniconda-version: 'latest'
|
miniforge-version: latest
|
||||||
channels: conda-forge,robostack-staging,defaults
|
use-mamba: true
|
||||||
|
channels: conda-forge,robostack-staging
|
||||||
channel-priority: strict
|
channel-priority: strict
|
||||||
activate-environment: build-env
|
activate-environment: build-env
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
@@ -110,7 +114,7 @@ jobs:
|
|||||||
- name: Install rattler-build and anaconda-client
|
- name: Install rattler-build and anaconda-client
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
conda install -c conda-forge rattler-build anaconda-client
|
mamba install --override-channels -c conda-forge rattler-build anaconda-client -y
|
||||||
|
|
||||||
- name: Show environment info
|
- name: Show environment info
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
@@ -157,7 +161,13 @@ jobs:
|
|||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Upload to Anaconda.org (unilab organization)
|
- name: Upload to Anaconda.org (unilab organization)
|
||||||
if: steps.should_build.outputs.should_build == 'true' && github.event.inputs.upload_to_anaconda == 'true'
|
if: |
|
||||||
|
steps.should_build.outputs.should_build == 'true' &&
|
||||||
|
(
|
||||||
|
github.event_name == 'release' ||
|
||||||
|
startsWith(github.ref, 'refs/tags/') ||
|
||||||
|
github.event.inputs.upload_to_anaconda == 'true'
|
||||||
|
)
|
||||||
run: |
|
run: |
|
||||||
for package in $(find ./output -name "*.conda"); do
|
for package in $(find ./output -name "*.conda"); do
|
||||||
echo "Uploading $package to unilab organization..."
|
echo "Uploading $package to unilab organization..."
|
||||||
|
|||||||
57
.github/workflows/unilabos-conda-build.yml
vendored
57
.github/workflows/unilabos-conda-build.yml
vendored
@@ -1,14 +1,10 @@
|
|||||||
name: UniLabOS Conda Build
|
name: UniLabOS Conda Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 在 CI Check 成功后自动触发
|
# 在 Multi-Platform Conda Build 成功上传 msgs 后自动触发
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["CI Check"]
|
workflows: ["Multi-Platform Conda Build"]
|
||||||
types: [completed]
|
types: [completed]
|
||||||
branches: [main, dev]
|
|
||||||
# 标签推送时直接触发(发布版本)
|
|
||||||
push:
|
|
||||||
tags: ['v*']
|
|
||||||
# 手动触发
|
# 手动触发
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -33,30 +29,30 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 等待 CI Check 完成的 job (仅用于 workflow_run 触发)
|
# 等待上游 msgs 构建完成的 job (仅用于 workflow_run 触发)
|
||||||
wait-for-ci:
|
wait-for-upstream:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'workflow_run'
|
if: github.event_name == 'workflow_run'
|
||||||
outputs:
|
outputs:
|
||||||
should_continue: ${{ steps.check.outputs.should_continue }}
|
should_continue: ${{ steps.check.outputs.should_continue }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check CI status
|
- name: Check upstream workflow status
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
|
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" && ( "${{ github.event.workflow_run.event }}" == "release" || "${{ github.event.workflow_run.event }}" == "push" ) ]]; then
|
||||||
echo "should_continue=true" >> $GITHUB_OUTPUT
|
echo "should_continue=true" >> $GITHUB_OUTPUT
|
||||||
echo "CI Check passed, proceeding with build"
|
echo "Multi-Platform Conda Build passed for release/tag, proceeding with UniLabOS build"
|
||||||
else
|
else
|
||||||
echo "should_continue=false" >> $GITHUB_OUTPUT
|
echo "should_continue=false" >> $GITHUB_OUTPUT
|
||||||
echo "CI Check did not succeed (status: ${{ github.event.workflow_run.conclusion }}), skipping build"
|
echo "Upstream workflow is not a successful release/tag build (status: ${{ github.event.workflow_run.conclusion }}, event: ${{ github.event.workflow_run.event }}), skipping build"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: [wait-for-ci]
|
needs: [wait-for-upstream]
|
||||||
# 运行条件:workflow_run 触发且 CI 成功,或者其他触发方式
|
# 运行条件:workflow_run 触发且上游成功,或者手动触发
|
||||||
if: |
|
if: |
|
||||||
always() &&
|
always() &&
|
||||||
(needs.wait-for-ci.result == 'skipped' || needs.wait-for-ci.outputs.should_continue == 'true')
|
(needs.wait-for-upstream.result == 'skipped' || needs.wait-for-upstream.outputs.should_continue == 'true')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -79,7 +75,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
# 如果是 workflow_run 触发,使用触发 CI Check 的 commit
|
# 如果是 workflow_run 触发,使用上游 conda 包构建的 commit
|
||||||
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
|
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -96,12 +92,13 @@ jobs:
|
|||||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Setup Miniconda
|
- name: Setup Miniforge
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
uses: conda-incubator/setup-miniconda@v3
|
uses: conda-incubator/setup-miniconda@v3
|
||||||
with:
|
with:
|
||||||
miniconda-version: 'latest'
|
miniforge-version: latest
|
||||||
channels: conda-forge,robostack-staging,uni-lab,defaults
|
use-mamba: true
|
||||||
|
channels: conda-forge,robostack-staging,uni-lab
|
||||||
channel-priority: strict
|
channel-priority: strict
|
||||||
activate-environment: build-env
|
activate-environment: build-env
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
@@ -110,7 +107,7 @@ jobs:
|
|||||||
- name: Install rattler-build and anaconda-client
|
- name: Install rattler-build and anaconda-client
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
conda install -c conda-forge rattler-build anaconda-client
|
mamba install --override-channels -c conda-forge rattler-build anaconda-client -y
|
||||||
|
|
||||||
- name: Show environment info
|
- name: Show environment info
|
||||||
if: steps.should_build.outputs.should_build == 'true'
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
@@ -119,11 +116,11 @@ jobs:
|
|||||||
conda list | grep -E "(rattler-build|anaconda-client)"
|
conda list | grep -E "(rattler-build|anaconda-client)"
|
||||||
echo "Platform: ${{ matrix.platform }}"
|
echo "Platform: ${{ matrix.platform }}"
|
||||||
echo "OS: ${{ matrix.os }}"
|
echo "OS: ${{ matrix.os }}"
|
||||||
echo "Build full package: ${{ github.event.inputs.build_full || 'false' }}"
|
echo "Build full package: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build_full == 'true' }}"
|
||||||
echo "Building packages:"
|
echo "Building packages:"
|
||||||
echo " - unilabos-env (environment dependencies)"
|
echo " - unilabos-env (environment dependencies)"
|
||||||
echo " - unilabos (with pip package)"
|
echo " - unilabos (with pip package)"
|
||||||
if [[ "${{ github.event.inputs.build_full }}" == "true" ]]; then
|
if [[ "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build_full == 'true' }}" == "true" ]]; then
|
||||||
echo " - unilabos-full (complete package)"
|
echo " - unilabos-full (complete package)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -134,7 +131,12 @@ jobs:
|
|||||||
rattler-build build -r .conda/environment/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge
|
rattler-build build -r .conda/environment/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge
|
||||||
|
|
||||||
- name: Upload unilabos-env to Anaconda.org (if enabled)
|
- name: Upload unilabos-env to Anaconda.org (if enabled)
|
||||||
if: steps.should_build.outputs.should_build == 'true' && github.event.inputs.upload_to_anaconda == 'true'
|
if: |
|
||||||
|
steps.should_build.outputs.should_build == 'true' &&
|
||||||
|
(
|
||||||
|
github.event_name == 'workflow_run' ||
|
||||||
|
github.event.inputs.upload_to_anaconda == 'true'
|
||||||
|
)
|
||||||
run: |
|
run: |
|
||||||
echo "Uploading unilabos-env to uni-lab organization..."
|
echo "Uploading unilabos-env to uni-lab organization..."
|
||||||
for package in $(find ./output -name "unilabos-env*.conda"); do
|
for package in $(find ./output -name "unilabos-env*.conda"); do
|
||||||
@@ -149,7 +151,12 @@ jobs:
|
|||||||
rattler-build build -r .conda/base/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge --channel ./output
|
rattler-build build -r .conda/base/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge --channel ./output
|
||||||
|
|
||||||
- name: Upload unilabos to Anaconda.org (if enabled)
|
- name: Upload unilabos to Anaconda.org (if enabled)
|
||||||
if: steps.should_build.outputs.should_build == 'true' && github.event.inputs.upload_to_anaconda == 'true'
|
if: |
|
||||||
|
steps.should_build.outputs.should_build == 'true' &&
|
||||||
|
(
|
||||||
|
github.event_name == 'workflow_run' ||
|
||||||
|
github.event.inputs.upload_to_anaconda == 'true'
|
||||||
|
)
|
||||||
run: |
|
run: |
|
||||||
echo "Uploading unilabos to uni-lab organization..."
|
echo "Uploading unilabos to uni-lab organization..."
|
||||||
for package in $(find ./output -name "unilabos-0*.conda" -o -name "unilabos-[0-9]*.conda"); do
|
for package in $(find ./output -name "unilabos-0*.conda" -o -name "unilabos-[0-9]*.conda"); do
|
||||||
@@ -159,6 +166,7 @@ jobs:
|
|||||||
- name: Build unilabos-full - Only when explicitly requested
|
- name: Build unilabos-full - Only when explicitly requested
|
||||||
if: |
|
if: |
|
||||||
steps.should_build.outputs.should_build == 'true' &&
|
steps.should_build.outputs.should_build == 'true' &&
|
||||||
|
github.event_name == 'workflow_dispatch' &&
|
||||||
github.event.inputs.build_full == 'true'
|
github.event.inputs.build_full == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Building unilabos-full package on ${{ matrix.platform }}..."
|
echo "Building unilabos-full package on ${{ matrix.platform }}..."
|
||||||
@@ -167,6 +175,7 @@ jobs:
|
|||||||
- name: Upload unilabos-full to Anaconda.org (if enabled)
|
- name: Upload unilabos-full to Anaconda.org (if enabled)
|
||||||
if: |
|
if: |
|
||||||
steps.should_build.outputs.should_build == 'true' &&
|
steps.should_build.outputs.should_build == 'true' &&
|
||||||
|
github.event_name == 'workflow_dispatch' &&
|
||||||
github.event.inputs.build_full == 'true' &&
|
github.event.inputs.build_full == 'true' &&
|
||||||
github.event.inputs.upload_to_anaconda == 'true'
|
github.event.inputs.upload_to_anaconda == 'true'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
channel_sources:
|
channel_sources:
|
||||||
- robostack,robostack-staging,conda-forge,defaults
|
- robostack,robostack-staging,conda-forge
|
||||||
|
|
||||||
gazebo:
|
gazebo:
|
||||||
- '11'
|
- '11'
|
||||||
|
|||||||
Reference in New Issue
Block a user