1027
Some checks failed
Workflow A / job_a (push) Has been cancelled
Sequential Workflows / job_a (push) Successful in 3s
Sequential Workflows / job_b (push) Successful in 3s
Sequential Workflows / job_c (push) Successful in 2s

This commit is contained in:
298977887 2024-10-27 19:33:49 +08:00
parent 29b4989dda
commit 4ff121f32c
6 changed files with 258 additions and 1 deletions

23
.github/workflows/A.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Workflow A
on:
push:
branches:
- main
jobs:
job_a:
runs-on: ubuntu-latest
steps:
- name: Step 1 in Workflow A
run: echo "Running Workflow A"
- name: Create completion marker for Workflow A
run: echo "done" > marker_a
- name: Commit marker
run: |
git config user.name "Gitea CI"
git config user.email "ci@example.com"
git add marker_a
git commit -m "Add completion marker for A"
git push

23
.github/workflows/B.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Workflow B
on:
push:
paths:
- marker_a
jobs:
job_b:
runs-on: ubuntu-latest
steps:
- name: Step 1 in Workflow B
run: echo "Running Workflow B"
- name: Create completion marker for Workflow B
run: echo "done" > marker_b
- name: Commit marker
run: |
git config user.name "Gitea CI"
git config user.email "ci@example.com"
git add marker_b
git commit -m "Add completion marker for B"
git push

13
.github/workflows/C.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: Workflow C
on:
push:
paths:
- marker_b
jobs:
job_c:
runs-on: ubuntu-latest
steps:
- name: Step 1 in Workflow C
run: echo "Running Workflow C"

27
.github/workflows/D.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Sequential Workflows
on:
push:
branches:
- main
jobs:
job_a:
runs-on: ubuntu-latest
steps:
- name: Run Workflow A
run: echo "Running Workflow A"
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"

162
.github/workflows/zzz.yml vendored Normal file
View File

@ -0,0 +1,162 @@
name: 🏗️ 构建 OpenWrt 稳定版
# 触发条件push, pull_request, 定时每天和手动触发workflow_dispatch
on:
#push:
# branches:
# - main # 只有在 main 分支 push 时触发
#pull_request: # PR 时触发
#schedule:
# - cron: '0 0 * * *' # 每天自动触发一次
workflow_dispatch: # 手动触发
jobs:
build:
#runs-on: ubuntu-22.04
runs-on: ubuntu-builder
steps:
- name: 🛒 检出代码 - 获取最新的代码库状态
uses: actions/checkout@v3
#配置git代理http和https为192.168.1.20:7890
#- name: 🛠️ 配置 Git 代理
# run: |
# git config --global http.proxy http://192.168.1.20:7890
# git config --global https.proxy http://192.168.1.20:7890
#打印git配置信息
- name: 📄 打印 Git 配置信息
run: |
git config --list
#打印git代理配置信息
#- name: 📄 打印 Git 代理配置信息
# run: |
# git config --global --get http.proxy
# git config --global --get https.proxy
- name: 📥 克隆 LEDE 源码
run: |
git clone https://github.com/coolsnowwolf/lede
cd lede
#添加源
- name: 📦 添加源
run: |
cd lede
echo "当前目录:" && pwd
echo "当前用户为:" && whoami
#echo 'src-git istore https://github.com/linkease/istore;main' >> feeds.conf.default
#echo 'src-git kenzo https://github.com/kenzok8/openwrt-packages' >> feeds.conf.default
#echo 'src-git small https://github.com/kenzok8/small' >> feeds.conf.default
#打印feeds.conf.default文件内容
- name: 📄 打印 feeds.conf.default 文件内容
run: |
cat lede/feeds.conf.default
#执行./scripts/feeds update -a 和./scripts/feeds install -a
- name: 🔄 更新 feeds 并安装
run: |
cd lede
./scripts/feeds update -a
#延时5秒
sleep 5
./scripts/feeds update -a
./scripts/feeds install -a
- name: 📦 获取固件版本 - 检索当前固件的版本信息
run: |
cd lede
grep '"DISTRIB_REVISION=' */*/default-settings/files/zzz-default-settings | cut -d"'" -f2
# 获取 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"
- name: 📄 创建并写入 DISTRIB_REVISION.txt 文件 - 记录分发版本
run: |
# 获取当前日期和时间 - 格式为“2024年1月31日15时24分36秒更新”
CURRENT_DATE=$(date +"%Y年%m月%d日%H时%M分")
#日期TAG格式为“0131-15”表示1月31日15时
CURRENT_DATE_TAG=$(date +"%m%d-%H")
echo "当前日期: $CURRENT_DATE"
# 将当前日期和时间设置为环境变量
echo "CURRENT_DATE=$(date +'%Y年%m月%d日%H时%M分')" >> $GITHUB_ENV
# 将日期TAG写入环境变量
echo "CURRENT_DATE_TAG=$CURRENT_DATE_TAG" >> $GITHUB_ENV
# 写入文件,以便在发布中使用
echo -e "${CURRENT_DATE}更新\n${{ env.distrib_revision }}" > DISTRIB_REVISION.txt
cat DISTRIB_REVISION.txt # 确认文件内容
- name: 📑 拷贝.config文件 - 确认配置文件状态
run: |
echo "📂当前目录:" && pwd
ls -la #la表示显示所有文件包括隐藏文件
# 重命名当前目录下的配置文件并拷贝到 lede 目录下
cp "lede;RUI;x86_64.config" lede/.config
- name: 🔧 设置编译配置
run: |
cd lede
# make menuconfig # 这里您可以根据需要修改配置
make defconfig # 生成默认的 .config 文件
- name: 🔨 编译前准备 - 下载 dl 库
run: |
cd lede
#make defconfig
make download -j8 V=s
- name: 🚀 启用多线程编译
run: |
cd lede
#make V=s -j$(nproc) #使用所有 CPU 编译
# 使用 V=0 关闭详细输出
make V=s -j$(nproc)
- name: 🗃️ 整理文件 - 优化文件结构
if: success() && !cancelled()
run: |
echo "当前目录:" && pwd
# 查看当前目录下的文件
ls -al
# 查看磁盘空间
df -hT
# 进入固件目录
cd lede/bin/targets/*/*
# 删除不需要的文件
rm -rf packages *.bin *.json *.buildinfo *.manifest sha256sums
# 设置固件所在的目录路径并写入环境变量
echo "firmware_path=$PWD" >> $GITHUB_ENV
- name: 📂 固件路径 - 显示固件路径
run: |
echo "Firmware path: ${{ env.firmware_path }}"
- name: 🚀 上传固件到 Release - 发布最新固件
uses: akkuman/gitea-release-action@v1
env:
NODE_OPTIONS: "--experimental-fetch" # 如果 Node.js 版本 < 18
NODE_TLS_REJECT_UNAUTHORIZED: "0" # 如果您需要忽略 SSL 验证错误
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} # 确保在 Gitea 的仓库 Secrets 中设置了 GITEA_TOKEN
with:
#server_url: "https://git.aoun.ltd/" # 您的 Gitea API URL 默认为仓库地址
repository: "18152827937/OpenWrt-Stable" # 您的 Gitea 仓库
name: "最新发布版本:${{ env.distrib_revision }}" # 发布名称
# 使用固件版本和日期TAG作为标签
tag_name: ${{ env.distrib_revision }}-${{ env.CURRENT_DATE_TAG }}
files: ${{ env.firmware_path }}/* # /* 表示上传所有文件
body: |
## 固件版本
- 版本号:`${{ env.distrib_revision }}`
- 发布日期:`${{ env.CURRENT_DATE }}`
## 官方网站
- 点我访问[固件发布官方网站](https://xiangzi.ltd/)

View File

@ -1,2 +1,11 @@
# gitea-action-test
## OpenWrt/LEDE x86_64 固件
- 本固件中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件;
- 使用最新的源码,稳定性和兼容性经过验证,并且会持续更新;
- SSL 安全是互联网最后的壁垒。<span style="color: #3366ff;"><strong>安全、稳定、干净</strong></span> 才是固件应该做到的!
</br>
![Latest Version](https://img.shields.io/badge/最新版本-R24.10.24--1027--18-brightgreen)
### 固件说明
...