-
Notifications
You must be signed in to change notification settings - Fork 66
123 lines (107 loc) · 4.42 KB
/
Update_Checker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# Copyright (c) 2019-2024 smallprogram
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/smallprogram/OpenWrtAction
# File: .github/workflows/Update_Checker.yml
# Description: Source code update checker
#
name: Update_Checker
on:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
schedule:
- cron: 0 4 * * *
# 0 4 * * 5
# 0 4,12,20 * * *
env:
UPDATE_CHECKER: compile_script/update_checker.sh
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: SSH connection to Actions
uses: P3TERX/[email protected]
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Get Commit Hash
id: getHash
run: |
chmod +x $UPDATE_CHECKER
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/immortalwrt/immortalwrt" "01"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/immortalwrt/packages" "02"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/immortalwrt/luci" "03"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/coolsnowwolf/lede" "04"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/coolsnowwolf/packages" "05"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/coolsnowwolf/luci" "06"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/openwrt/openwrt" "07"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/openwrt/packages" "08"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/openwrt/luci" "09"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/openwrt/routing" "10"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/openwrt/telephony" "11"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/xiaorouji/openwrt-passwall-packages" "12"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/xiaorouji/openwrt-passwall" "13"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/xiaorouji/openwrt-passwall2" "14"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/fw876/helloworld" "15"
$GITHUB_WORKSPACE/$UPDATE_CHECKER "https://github.com/vernesong/OpenClash" "16"
- name: Show Commit Head and Combination Heads
id: combHeader
run: |
echo "commitHash_All=\
${{steps.getHash.outputs.SHA_01}}\
${{steps.getHash.outputs.SHA_02}}\
${{steps.getHash.outputs.SHA_03}}\
${{steps.getHash.outputs.SHA_04}}\
${{steps.getHash.outputs.SHA_05}}\
${{steps.getHash.outputs.SHA_06}}\
${{steps.getHash.outputs.SHA_07}}\
${{steps.getHash.outputs.SHA_08}}\
${{steps.getHash.outputs.SHA_09}}\
${{steps.getHash.outputs.SHA_10}}\
${{steps.getHash.outputs.SHA_11}}\
${{steps.getHash.outputs.SHA_12}}\
${{steps.getHash.outputs.SHA_13}}\
${{steps.getHash.outputs.SHA_14}}\
${{steps.getHash.outputs.SHA_15}}\
${{steps.getHash.outputs.SHA_16}}" >> $GITHUB_OUTPUT
- name: Compare Commit Hash
id: cacheHash
uses: actions/cache@v4
with:
path: .commitHash_All
key: HEAD-${{ steps.combHeader.outputs.commitHash_All }}
- name: Save New Commit Hash
if: steps.cacheHash.outputs.cache-hit != 'true'
run: |
echo ${{ steps.combHeader.outputs.commitHash_All }} | tee .commitHash_All
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 1
keep_minimum_runs: 3
- name: Remove old Releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 10
keep_min_download_counts: 2
delete_expired_data: 90
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger build
if: steps.cacheHash.outputs.cache-hit != 'true'
uses: peter-evans/repository-dispatch@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: openwrt_source_update