File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 5
5
push :
6
6
tags :
7
7
- v**
8
+ schedule :
9
+ - cron : ' 37 2 * * 0'
8
10
9
11
concurrency :
10
12
group : ${{ github.workflow }}-${{ github.ref }}
11
13
cancel-in-progress : true
12
14
13
15
jobs :
16
+ check-commits :
17
+ runs-on : ubuntu-latest
18
+ outputs :
19
+ should_run : ${{ steps.check.outputs.should_run }}
20
+ steps :
21
+ - uses : actions/checkout@v3
22
+
23
+ - name : Install GitHub CLI
24
+ run : sudo apt-get update && sudo apt-get install -y gh
25
+
26
+ - name : Check for new commits since last successful run
27
+ id : check
28
+ run : |
29
+ if [ "${{ github.event_name }}" != "schedule" ]; then
30
+ echo "should_run=true" >> $GITHUB_OUTPUT
31
+ exit 0
32
+ fi
33
+ LAST_SUCCESS=$(gh run list --workflow build.yml --branch ${{ github.ref_name }} --status success --limit 1 --json startedAt --jq '.[0].startedAt')
34
+ if [ -z "$LAST_SUCCESS" ]; then
35
+ echo "No previous successful run, continuing."
36
+ echo "should_run=true" >> $GITHUB_OUTPUT
37
+ exit 0
38
+ fi
39
+ NEW_COMMITS=$(git rev-list --count --since="$LAST_SUCCESS" ${{ github.ref_name }})
40
+ if [ "$NEW_COMMITS" -eq 0 ]; then
41
+ echo "No new commits since last successful run, skipping workflow."
42
+ echo "should_run=false" >> $GITHUB_OUTPUT
43
+ exit 0
44
+ fi
45
+ echo "should_run=true" >> $GITHUB_OUTPUT
46
+
14
47
download-dbip :
48
+ needs : check-commits
49
+ if : needs.check-commits.outputs.should_run == 'true'
15
50
runs-on : ubuntu-latest
16
51
steps :
17
52
- uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ Planned:
34
34
35
35
Transmission v2.40 or later is required.
36
36
37
+ ## Downloads
38
+
39
+ You can get the latest release from the
40
+ [ releases page] ( https://github.com/openscopeproject/TrguiNG/releases ) .
41
+
42
+ Weekly builds of current development version are available from github
43
+ [ build workflows] ( https://github.com/openscopeproject/TrguiNG/actions/workflows/build.yml ) .
44
+ Pick the latest successful run and scroll down to the artifacts section.
45
+
37
46
## Compiling
38
47
39
48
Prerequisites:
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ url_last_month="https://download.db-ip.com/free/dbip-country-lite-$last_month.mm
9
9
output_file=" dbip-country-lite.mmdb.gz"
10
10
11
11
echo " Trying to download today's DB-IP file..."
12
- wget -O " $output_file " " $url_today "
12
+ wget -q - O " $output_file " " $url_today "
13
13
if [ $? -eq 0 ]; then
14
14
echo " Downloaded today's file successfully."
15
15
else
16
16
echo " Today's file not available. Trying last month's file..."
17
- wget -O " $output_file " " $url_last_month "
17
+ wget -q - O " $output_file " " $url_last_month "
18
18
if [ $? -eq 0 ]; then
19
19
echo " Downloaded last month's file successfully."
20
20
else
You can’t perform that action at this time.
0 commit comments