Skip to content

Commit

Permalink
add self-hosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneGreen committed Oct 15, 2023
1 parent 577eb5e commit 7c399d3
Showing 1 changed file with 118 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/R2S-selfhosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: OpenWrt for R2S self-hosted

on:
push:
branches:
- master
paths:
- 'CHANGELOG.md'
- '.github/workflows/R2S-selfhosted.yml'

env:
UPLOAD_FIRMWARE: true
TZ: Asia/Shanghai
MYOPENWRTTARGET: R2S

jobs:
build:
runs-on: [self-hosted, Linux, X64]
if: github.event.repository.owner.id == github.event.sender.id

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'master'

- name: Prepare OpenWrt
run: |
cp -f ./SCRIPTS/01_get_ready.sh ./01_get_ready.sh
echo "FMDATETIME=$(date '+%Y%m%d-%H%M')" >> $GITHUB_ENV
/bin/bash ./01_get_ready.sh
- name: Prepare Package
run: |
cp -f ./SCRIPTS/*.sh ./openwrt/
cd openwrt
/bin/bash ./02_prepare_package.sh
- name: Remove Upx
run: |
cd openwrt
/bin/bash ./03_remove_upx.sh
- name: Convert Translation
run: |
cd openwrt
/bin/bash ./04_convert_translation.sh
- name: Add ACL
run: |
cd openwrt
/bin/bash ./05_create_acl_for_luci.sh -a
- name: Make Config
run: |
cd openwrt
cp -f ../SEED/R2S.config.seed .config
cat ../SEED/more.seed >> .config
make defconfig
- name: Make Download
run: |
df -h
cd openwrt && make download -j$(($(nproc) * 8))
echo $?
- name: Make Toolchain
id: maketoolchain
continue-on-error: true
run: |
df -h
cd openwrt && make toolchain/install -j$(($(nproc) + 1))
echo $?
/bin/ls -AF staging_dir/toolchain-*/bin/
- name: If Toolchain Error
if: steps.maketoolchain.outcome == 'failure'
run: |
df -h
cd openwrt && make toolchain/install -j1 V=s
- name: Compile OpenWrt
id: compileopenwrt
continue-on-error: true
run: |
df -h
cd openwrt && make -j$(($(nproc) + 1)) V=w
echo $?
- name: If Compiling Error
if: steps.compileopenwrt.outcome == 'failure'
run: |
df -h
cat openwrt/.config
echo '================================================================'
cd openwrt && make -j1 V=s
- name: Cleaning and hashing
run: |
rm -rf ./artifact && mkdir -p ./artifact
cd ./artifact
echo "FIRMWAREDIR=$(pwd)" >> $GITHUB_ENV
cd ../openwrt
cp -f ../clean_flash.sh ../artifact/clean_flash.sh
cp -f .config ../artifact/kconfig-full
/bin/bash ./scripts/diffconfig.sh > ../artifact/kconfig-lite
cd bin/targets/rockchip/armv8
ls -Ahl
/bin/bash ../../../../../SCRIPTS/06_cleaning.sh
mv -f ./* ../../../../../artifact/
echo "status=success" >> $GITHUB_OUTPUT
- name: Upload Firmwares
uses: actions/upload-artifact@v3
if: env.UPLOAD_FIRMWARE == 'true' && ${{ success() }}
with:
name: OpenWrt_R2S_${{ env.FMDATETIME }}
path: ${{ env.FIRMWAREDIR }}

0 comments on commit 7c399d3

Please sign in to comment.