Skip to content

测试构建

测试构建 #19

Workflow file for this run

name: 测试构建
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: 编译 "${{matrix.platform}} ${{matrix.version}}"
strategy:
fail-fast: false
matrix:
include:
# 两行一组,删除不需要的版本
- platform: apollolake
version: 7.0.1-42218
steps:
- name: 检出项目文件
uses: actions/checkout@v2
- name: 缓存加速
uses: actions/cache@v2
with:
path: |
cache/*.pat
docker/downloads/*.txz
key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }}
- name: 准备构建环境
run: |
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}}
- name: 配置引导镜像
env:
DS918P_PID: ${{ secrets.DS918P_PID }}
DS918P_VID: ${{ secrets.DS918P_VID }}
DS918P_SN: ${{ secrets.DS918P_SN }}
DS918P_MAC: ${{ secrets.DS918P_MAC }}
run: |
cp sample_user_config.json ${{matrix.platform}}_user_config.json
# 调整VID和PID
sed -i "s/0x46f4/${DS918P_VID}/g" ${{matrix.platform}}_user_config.json
sed -i "s/0x0001/${DS918P_PID}/g" ${{matrix.platform}}_user_config.json
# 调整SN和MAC 最好使用 actions secrets 引入
sed -i "s/1234XXX123/${DS918P_SN}/g" ${{matrix.platform}}_user_config.json
sed -i "s/XXYYXXYYXXYY/${DS918P_MAC}/g" ${{matrix.platform}}_user_config.json
# 添加扩展驱动
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/e1000e/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/vmxnet3/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/mpt3sas/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/ixgbe/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/r8125/rpext-index.json
- name: 编译引导镜像
run: ./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}}
- name: 上传引导镜像到 github actions
uses: actions/upload-artifact@v4
with:
name: dsm-${{matrix.platform}}-${{matrix.version}}
path: images/redpill-DS[39]*.img
if-no-files-found: error
- name: 删除旧的工作流
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 3
keep_minimum_runs: 6