mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-05 05:45:10 +00:00
移除post-link脚本,更新构建配置以支持多平台构建,调整依赖项以适应不同操作系统。
This commit is contained in:
@@ -7,7 +7,6 @@ source:
|
|||||||
target_directory: unilabos
|
target_directory: unilabos
|
||||||
|
|
||||||
build:
|
build:
|
||||||
noarch: python
|
|
||||||
script:
|
script:
|
||||||
- set PIP_NO_INDEX=
|
- set PIP_NO_INDEX=
|
||||||
- if: win
|
- if: win
|
||||||
@@ -33,8 +32,10 @@ requirements:
|
|||||||
- conda-forge::python ==3.11.11
|
- conda-forge::python ==3.11.11
|
||||||
- compilers
|
- compilers
|
||||||
- cmake
|
- cmake
|
||||||
- make
|
|
||||||
- ninja
|
- ninja
|
||||||
|
- if: unix
|
||||||
|
then:
|
||||||
|
- make
|
||||||
- sphinx
|
- sphinx
|
||||||
- sphinx_rtd_theme
|
- sphinx_rtd_theme
|
||||||
- numpy
|
- numpy
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM upgrade pip
|
|
||||||
"%PREFIX%\python.exe" -m pip install --upgrade pip
|
|
||||||
|
|
||||||
REM install extra deps
|
|
||||||
"%PREFIX%\python.exe" -m pip install paho-mqtt opentrons_shared_data
|
|
||||||
"%PREFIX%\python.exe" -m pip install git+https://github.com/Xuwznln/pylabrobot.git
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euxo pipefail
|
|
||||||
|
|
||||||
# make sure pip is available
|
|
||||||
"$PREFIX/bin/python" -m pip install --upgrade pip
|
|
||||||
|
|
||||||
# install extra deps
|
|
||||||
"$PREFIX/bin/python" -m pip install paho-mqtt opentrons_shared_data
|
|
||||||
"$PREFIX/bin/python" -m pip install git+https://github.com/Xuwznln/pylabrobot.git
|
|
||||||
46
.github/workflows/unilabos-conda-build.yml
vendored
46
.github/workflows/unilabos-conda-build.yml
vendored
@@ -8,6 +8,10 @@ on:
|
|||||||
branches: [main, dev]
|
branches: [main, dev]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
platforms:
|
||||||
|
description: '选择构建平台 (逗号分隔): linux-64, osx-64, osx-arm64, win-64'
|
||||||
|
required: false
|
||||||
|
default: 'linux-64'
|
||||||
upload_to_anaconda:
|
upload_to_anaconda:
|
||||||
description: '是否上传到Anaconda.org'
|
description: '是否上传到Anaconda.org'
|
||||||
required: false
|
required: false
|
||||||
@@ -16,7 +20,20 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: linux-64
|
||||||
|
- os: macos-13 # Intel
|
||||||
|
platform: osx-64
|
||||||
|
- os: macos-latest # ARM64
|
||||||
|
platform: osx-arm64
|
||||||
|
- os: windows-latest
|
||||||
|
platform: win-64
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -27,7 +44,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check if platform should be built
|
||||||
|
id: should_build
|
||||||
|
run: |
|
||||||
|
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
|
||||||
|
elif [[ "${{ github.event.inputs.platforms }}" == *"${{ matrix.platform }}"* ]]; then
|
||||||
|
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Miniconda
|
- name: Setup Miniconda
|
||||||
|
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'
|
miniconda-version: 'latest'
|
||||||
@@ -39,28 +70,36 @@ jobs:
|
|||||||
show-channel-urls: true
|
show-channel-urls: true
|
||||||
|
|
||||||
- name: Install rattler-build and anaconda-client
|
- name: Install rattler-build and anaconda-client
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
conda install -c conda-forge rattler-build anaconda-client
|
conda install -c conda-forge rattler-build anaconda-client
|
||||||
|
|
||||||
- name: Show environment info
|
- name: Show environment info
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
conda info
|
conda info
|
||||||
conda list | grep -E "(rattler-build|anaconda-client)"
|
conda list | grep -E "(rattler-build|anaconda-client)"
|
||||||
|
echo "Platform: ${{ matrix.platform }}"
|
||||||
|
echo "OS: ${{ matrix.os }}"
|
||||||
echo "Building UniLabOS package"
|
echo "Building UniLabOS package"
|
||||||
|
|
||||||
- name: Build conda package
|
- name: Build conda package
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
rattler-build build -r .conda/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge
|
rattler-build build -r .conda/recipe.yaml -c uni-lab -c robostack-staging -c conda-forge
|
||||||
|
|
||||||
- name: List built packages
|
- name: List built packages
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Built packages in output directory:"
|
echo "Built packages in output directory:"
|
||||||
find ./output -name "*.conda" | head -10
|
find ./output -name "*.conda" | head -10
|
||||||
|
ls -la ./output/${{ matrix.platform }}/ || echo "${{ matrix.platform }} directory not found"
|
||||||
ls -la ./output/noarch/ || echo "noarch directory not found"
|
ls -la ./output/noarch/ || echo "noarch directory not found"
|
||||||
echo "Output directory structure:"
|
echo "Output directory structure:"
|
||||||
find ./output -type f -name "*.conda"
|
find ./output -type f -name "*.conda"
|
||||||
|
|
||||||
- name: Prepare artifacts for upload
|
- name: Prepare artifacts for upload
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p conda-packages-temp
|
mkdir -p conda-packages-temp
|
||||||
find ./output -name "*.conda" -exec cp {} conda-packages-temp/ \;
|
find ./output -name "*.conda" -exec cp {} conda-packages-temp/ \;
|
||||||
@@ -68,15 +107,16 @@ jobs:
|
|||||||
ls -la conda-packages-temp/
|
ls -la conda-packages-temp/
|
||||||
|
|
||||||
- name: Upload conda package artifacts
|
- name: Upload conda package artifacts
|
||||||
|
if: steps.should_build.outputs.should_build == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: conda-package-unilabos
|
name: conda-package-unilabos-${{ matrix.platform }}
|
||||||
path: conda-packages-temp
|
path: conda-packages-temp
|
||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Upload to Anaconda.org (uni-lab organization)
|
- name: Upload to Anaconda.org (uni-lab organization)
|
||||||
if: github.event.inputs.upload_to_anaconda == 'true'
|
if: steps.should_build.outputs.should_build == 'true' && (github.event.inputs.upload_to_anaconda == 'true' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request'))
|
||||||
run: |
|
run: |
|
||||||
for package in $(find ./output -name "*.conda"); do
|
for package in $(find ./output -name "*.conda"); do
|
||||||
echo "Uploading $package to uni-lab organization..."
|
echo "Uploading $package to uni-lab organization..."
|
||||||
|
|||||||
Reference in New Issue
Block a user