gitea-action-test/.github/workflows/D.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

2024-10-27 11:56:06 +00:00
#以下全部使用中文注释,方便理解
name: 顺序工作流
2024-10-27 11:33:49 +00:00
on:
2024-10-27 11:56:06 +00:00
# push:
# branches:
# - main
2024-10-27 11:33:49 +00:00
jobs:
job_a:
runs-on: ubuntu-latest
steps:
2024-10-27 11:56:06 +00:00
- name: 运行工作流A
2024-10-27 11:33:49 +00:00
run: echo "Running Workflow A"
2024-10-27 11:41:56 +00:00
- name: Clone source code # 步骤的名称
env:
REPO_URL: https://github.com/coolsnowwolf/lede # 仓库的URL地址
REPO_BRANCH: master # 需要克隆的分支名
run: |
2024-10-27 11:43:12 +00:00
git clone --depth 1 $REPO_URL -b $REPO_BRANCH
2024-10-27 11:41:56 +00:00
2024-10-27 11:56:06 +00:00
- name: 📦 获取固件版本 - 检索当前固件的版本信息
2024-10-27 11:41:56 +00:00
run: |
2024-10-27 11:56:06 +00:00
cd lede
# 获取 DISTRIB_REVISION 值
DISTRIB_REVISION=$(grep '"DISTRIB_REVISION=' */*/default-settings/files/zzz-default-settings | cut -d"'" -f2)
# 将值设置为环境变量
echo "distrib_revision=$DISTRIB_REVISION" >> $GITHUB_ENV
# 在日志中显示 DISTRIB_REVISION 的值
echo "DISTRIB_REVISION: $DISTRIB_REVISION"
2024-10-27 11:41:56 +00:00
2024-10-27 11:33:49 +00:00
job_b:
runs-on: ubuntu-latest
needs: job_a # 等待 job_a 完成
steps:
- name: Run Workflow B
run: echo "Running Workflow B"
job_c:
runs-on: ubuntu-latest
needs: job_b # 等待 job_b 完成
steps:
- name: Run Workflow C
run: echo "Running Workflow C"