优化 workflows

This commit is contained in:
Hyy2001X 2021-11-21 22:02:55 +08:00
parent 30fb28f762
commit 376c35b1ac
8 changed files with 68 additions and 52 deletions

View File

@ -117,28 +117,31 @@ jobs:
chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt
make defconfig > /dev/null 2>&1
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
Result=false
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)
make -j$(nproc) || make -j1 V=s
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV || echo "Result=false" >> $GITHUB_ENV
- name: Process Firmware
if: env.Result == 'true' && !cancelled()
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_End
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_End
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main

View File

@ -117,28 +117,31 @@ jobs:
chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt
make defconfig > /dev/null 2>&1
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
Result=false
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)
make -j$(nproc) || make -j1 V=s
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV || echo "Result=false" >> $GITHUB_ENV
- name: Process Firmware
if: env.Result == 'true' && !cancelled()
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_End
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_End
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main

View File

@ -117,28 +117,31 @@ jobs:
chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt
make defconfig > /dev/null 2>&1
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
Result=false
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)
make -j$(nproc) || make -j1 V=s
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV || echo "Result=false" >> $GITHUB_ENV
- name: Process Firmware
if: env.Result == 'true' && !cancelled()
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_End
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_End
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main

View File

@ -120,14 +120,16 @@ jobs:
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
rm -rf ./tmp
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)

View File

@ -117,28 +117,31 @@ jobs:
chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt
make defconfig > /dev/null 2>&1
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
Result=false
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)
make -j$(nproc) || make -j1 V=s
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV || echo "Result=false" >> $GITHUB_ENV
- name: Process Firmware
if: env.Result == 'true' && !cancelled()
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_End
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_End
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main

View File

@ -117,28 +117,31 @@ jobs:
chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt
make defconfig > /dev/null 2>&1
make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Before
rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile
run: |
Result=false
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig
make download -j$(nproc)
make -j$(nproc) || make -j1 V=s
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV
[ $? == 0 ] && echo "Result=true" >> $GITHUB_ENV || echo "Result=false" >> $GITHUB_ENV
- name: Process Firmware
if: env.Result == 'true' && !cancelled()
run: |
cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_End
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_End
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main

View File

@ -1,6 +1,5 @@
###########################################################
# Description: Compile OpenWrt by GitHub Actions #
# Based on: https://github.com/P3TERX/Actions-OpenWrt #
# Description: Refresh Release API #
# Author: Hyy2001X #
###########################################################
@ -11,14 +10,14 @@ on:
workflow_dispatch:
inputs:
refresh_switch:
description: '刷新 Release/API'
description: '手动刷新 API'
default: 'true'
schedule:
- cron: 0 4,16 * * *
jobs:
build:
Job:
runs-on: ubuntu-latest
steps:

View File

@ -1,32 +1,32 @@
############################################################
# Description: GitHub Action to synchronise forks #
# Description: GitHub Action to Synchronise Forks #
# Based on: danshui-git/github-forks-sync-action.git #
# Modify: Hyy2001X #
# Thanks to: https://github.com/281677160 #
############################################################
name: Synchronise Fork
name: Synchronise Forks
on:
repository_dispatch:
workflow_dispatch:
inputs:
sync_mode:
description: '确认同步上游所有内容'
description: '同步上游所有内容'
default: 'false'
env:
SCRIPT_FILE: Scripts/Sync.sh
jobs:
build:
Job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Run synchronise script
- name: Run Synchronise Script
run: |
[ "${{github.event.inputs.sync_mode}}" == true ] && {
bash $GITHUB_WORKSPACE/Scripts/Sync.sh ${{secrets.GITHUB_TOKEN}} ${{github.repository}} --sync-all