From 4cf838419050b2887912a0f4b14436f6bcdb23c3 Mon Sep 17 00:00:00 2001 From: LIRUI <298977887@qq.com> Date: Sun, 27 Oct 2024 19:56:06 +0800 Subject: [PATCH] 1027 --- .github/workflows/AAA.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/D.yml | 32 ++++++++++++++++---------------- 2 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/AAA.yml diff --git a/.github/workflows/AAA.yml b/.github/workflows/AAA.yml new file mode 100644 index 0000000..99987e6 --- /dev/null +++ b/.github/workflows/AAA.yml @@ -0,0 +1,34 @@ +#以下全部使用中文注释,方便理解 +name: 顺序工作流 + +on: + push: + branches: + - main + +jobs: + job_a: + runs-on: ubuntu-latest + steps: + - name: 运行工作流A + run: echo "这是工作流A" + + # 克隆仓库,加上适合合理的emoji表情,方便区分 + - name: 🚀 克隆仓库 + env: + REPO_URL: https://github.com/coolsnowwolf/lede # 仓库的URL地址 + REPO_BRANCH: master # 需要克隆的分支名 + run: | + git clone --depth 1 $REPO_URL -b $REPO_BRANCH + + - name: 📦 获取固件版本 - 检索当前固件的版本信息 + run: | + 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" \ No newline at end of file diff --git a/.github/workflows/D.yml b/.github/workflows/D.yml index b80e2f1..e59d067 100644 --- a/.github/workflows/D.yml +++ b/.github/workflows/D.yml @@ -1,15 +1,16 @@ -name: Sequential Workflows +#以下全部使用中文注释,方便理解 +name: 顺序工作流 on: - push: - branches: - - main +# push: +# branches: +# - main jobs: job_a: runs-on: ubuntu-latest steps: - - name: Run Workflow A + - name: 运行工作流A run: echo "Running Workflow A" - name: Clone source code # 步骤的名称 @@ -19,18 +20,17 @@ jobs: run: | git clone --depth 1 $REPO_URL -b $REPO_BRANCH - #显示当前路径 - - name: Show current path + - name: 📦 获取固件版本 - 检索当前固件的版本信息 run: | - pwd - #显示当前用户 - - name: Show current user - run: | - whoami - #显示当前目录 - - name: Show current directory - run: | - ls -l + 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" job_b: runs-on: ubuntu-latest