mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-04 13:25:13 +00:00
Fix Build 7
This commit is contained in:
33
.github/workflows/multi-platform-build.yml
vendored
33
.github/workflows/multi-platform-build.yml
vendored
@@ -22,13 +22,37 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
skip_ci_check:
|
||||||
|
description: '跳过等待 CI Check (手动触发时可选)'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# 等待 CI Check 完成的 job (仅用于 workflow_run 触发)
|
||||||
|
wait-for-ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'workflow_run'
|
||||||
|
outputs:
|
||||||
|
should_continue: ${{ steps.check.outputs.should_continue }}
|
||||||
|
steps:
|
||||||
|
- name: Check CI status
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
|
||||||
|
echo "should_continue=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "CI Check passed, proceeding with build"
|
||||||
|
else
|
||||||
|
echo "should_continue=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "CI Check did not succeed (status: ${{ github.event.workflow_run.conclusion }}), skipping build"
|
||||||
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# 只有当不是 workflow_run 触发,或者 CI Check 成功时才执行
|
needs: [wait-for-ci]
|
||||||
if: >-
|
# 运行条件:workflow_run 触发且 CI 成功,或者其他触发方式
|
||||||
github.event_name != 'workflow_run' ||
|
if: |
|
||||||
github.event.workflow_run.conclusion == 'success'
|
always() &&
|
||||||
|
(needs.wait-for-ci.result == 'skipped' || needs.wait-for-ci.outputs.should_continue == 'true')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -80,7 +104,6 @@ jobs:
|
|||||||
channels: conda-forge,robostack-staging,defaults
|
channels: conda-forge,robostack-staging,defaults
|
||||||
channel-priority: strict
|
channel-priority: strict
|
||||||
activate-environment: build-env
|
activate-environment: build-env
|
||||||
auto-activate-base: false
|
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
show-channel-urls: true
|
show-channel-urls: true
|
||||||
|
|
||||||
|
|||||||
37
.github/workflows/unilabos-conda-build.yml
vendored
37
.github/workflows/unilabos-conda-build.yml
vendored
@@ -26,17 +26,37 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
skip_ci_check:
|
||||||
|
description: '跳过等待 CI Check (手动触发时可选)'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# 等待 CI Check 完成的 job (仅用于 workflow_run 触发)
|
||||||
|
wait-for-ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'workflow_run'
|
||||||
|
outputs:
|
||||||
|
should_continue: ${{ steps.check.outputs.should_continue }}
|
||||||
|
steps:
|
||||||
|
- name: Check CI status
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
|
||||||
|
echo "should_continue=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "CI Check passed, proceeding with build"
|
||||||
|
else
|
||||||
|
echo "should_continue=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "CI Check did not succeed (status: ${{ github.event.workflow_run.conclusion }}), skipping build"
|
||||||
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# 只在以下情况运行:
|
needs: [wait-for-ci]
|
||||||
# 1. workflow_run 触发且 CI Check 成功
|
# 运行条件:workflow_run 触发且 CI 成功,或者其他触发方式
|
||||||
# 2. 标签推送(发布版本)
|
|
||||||
# 3. 手动触发
|
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'workflow_dispatch' ||
|
always() &&
|
||||||
github.event_name == 'push' ||
|
(needs.wait-for-ci.result == 'skipped' || needs.wait-for-ci.outputs.should_continue == 'true')
|
||||||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -59,6 +79,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
# 如果是 workflow_run 触发,使用触发 CI Check 的 commit
|
||||||
|
ref: ${{ github.event.workflow_run.head_sha || github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Check if platform should be built
|
- name: Check if platform should be built
|
||||||
@@ -82,7 +104,6 @@ jobs:
|
|||||||
channels: conda-forge,robostack-staging,uni-lab,defaults
|
channels: conda-forge,robostack-staging,uni-lab,defaults
|
||||||
channel-priority: strict
|
channel-priority: strict
|
||||||
activate-environment: build-env
|
activate-environment: build-env
|
||||||
auto-activate-base: false
|
|
||||||
auto-update-conda: false
|
auto-update-conda: false
|
||||||
show-channel-urls: true
|
show-channel-urls: true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user