forked from tossp/redpill-tool-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: 构建DSM7.1 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
clean_cache: | ||
description: 'Clear caches' | ||
required: false | ||
type: boolean | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "docker/**" | ||
- "**.sh" | ||
- "**.json" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: 编译 "${{matrix.platform}} ${{matrix.version}}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# 两行一组,删除不需要的版本 | ||
- platform: ds3615xs | ||
version: 7.1.0-42661 | ||
|
||
- platform: ds3617xs | ||
version: 7.1.0-42661 | ||
|
||
steps: | ||
- name: 检出项目文件 | ||
uses: actions/checkout@v3 | ||
|
||
- name: 缓存加速 | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
cache/*.pat | ||
cache/*.org | ||
docker/downloads/*.txz | ||
key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }} | ||
restore-keys: ${{matrix.platform}}-${{matrix.version}}- | ||
|
||
- name: 清理缓存 | ||
if: "${{ github.event.inputs.clean_cache == 'true' }}" | ||
run: | | ||
rm -rf cache/*.pat | ||
rm -rf cache/*.org | ||
rm -rf docker/downloads/*.txz | ||
- name: 准备构建环境 | ||
run: | | ||
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} | ||
- name: 配置引导镜像 | ||
run: | | ||
cp sample_user_config.json ${{matrix.platform}}_user_config.json | ||
# 调整VID和PID | ||
sed -i -e 's/0x0001/0x88AA/g' -e 's/0x46f4/0x88AA/g' ${{matrix.platform}}_user_config.json | ||
# 调整SN和MAC,最好使用 actions secrets 引入,SN应该是固定值不应该每次生成 | ||
sn=`./redpill_tool_chain.sh sn ${{matrix.platform}} | grep 'Serial Number' | awk '{print $3}'` | ||
sed -i -e "s/1234XXX123/${sn:="1130LWN123456"}/g" -e 's/XXYYXXYYXXYY/0011323D47F7/g' ${{matrix.platform}}_user_config.json | ||
# 添加第二张网卡mac并设置网卡数量 | ||
sed -i -e 's/0011323D47F7"/&,\n\t"mac2": "0011323D47F8",\n\t"netif_num": 2/' ${{matrix.platform}}_user_config.json | ||
# 调整synoinfo | ||
sed -i -e 's/"synoinfo": {},/"synoinfo": {\n\t"maxlanport": "2"\n },/' ${{matrix.platform}}_user_config.json | ||
cat ${{matrix.platform}}_user_config.json | ||
- name: 添加扩展驱动 | ||
if: matrix.platform != 'dva3221' | ||
run: | | ||
./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json | ||
./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-acpid.json | ||
./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-virtio.json | ||
./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-misc | ||
- name: 编译引导镜像 | ||
run: | | ||
sed -i 's/debian:8-slim/debian:10-slim/g' global_config.json | ||
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} | ||
./redpill_tool_chain.sh pat ${{matrix.platform}}-${{matrix.version}} | ||
sed -i 's/debian:10-slim/debian:8-slim/g' global_config.json | ||
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} | ||
./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}} | ||
- name: 上传引导镜像到 github actions | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dsm-${{matrix.platform}}-${{matrix.version}} | ||
path: images/redpill-*.img | ||
if-no-files-found: error | ||
|
||
- name: 删除旧的工作流 | ||
uses: Mattraks/delete-workflow-runs@v2 | ||
with: | ||
retain_days: 1 | ||
keep_minimum_runs: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
set -u | ||
|
||
if [ ${TARGET_REVISION} -lt 42218 ];then | ||
if [ ${TARGET_REVISION} -lt 42661 ];then | ||
exit 0 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters