优化 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 chmod +x Scripts/AutoBuild_*.sh
cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE openwrt/.config
cd openwrt cd openwrt
make defconfig > /dev/null 2>&1 make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Main && Firmware_Diy Firmware_Diy_Before
rm -f .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config rm .config && cp $GITHUB_WORKSPACE/Configs/$CONFIG_FILE .config
Firmware_Diy_Main
Firmware_Diy
- name: Compile - name: Compile
run: | run: |
Result=false
cd openwrt cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh && Firmware_Diy_Other source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
rm -rf ./tmp && ./scripts/feeds install -a > /dev/null 2>&1 Firmware_Diy_Other
./scripts/feeds install -a > /dev/null 2>&1
make defconfig make defconfig
make download -j$(nproc) make download -j$(nproc)
make -j$(nproc) || make -j1 V=s 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 - name: Process Firmware
if: env.Result == 'true' && !cancelled() if: env.Result == 'true' && !cancelled()
run: | run: |
cd openwrt 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 - name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main uses: actions/upload-artifact@main

View File

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

View File

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

View File

@ -120,14 +120,16 @@ jobs:
make defconfig make defconfig
source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh source $GITHUB_WORKSPACE/Scripts/AutoBuild_DiyScript.sh
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.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 - name: Compile
run: | run: |
cd openwrt cd openwrt
source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh source $GITHUB_WORKSPACE/Scripts/AutoBuild_Function.sh
Firmware_Diy_Other Firmware_Diy_Other
rm -rf ./tmp
./scripts/feeds install -a > /dev/null 2>&1 ./scripts/feeds install -a > /dev/null 2>&1
make defconfig make defconfig
make download -j$(nproc) make download -j$(nproc)

View File

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

View File

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

View File

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

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