Compare commits

...
5 Commits
Author SHA1 Message Date
junv 59c67bad8c Update the app version before build docker containers 2021-10-13 23:57:22 +11:00
junv-repo-bot c2881479a9 Update version 2021-10-13 12:51:45 +00:00
junvandGitHub 1f4a331147 Refine the logic of app new version checker (#181) 2021-10-13 23:48:37 +11:00
junv-repo-bot 461f0e9451 Update version 2021-10-13 12:22:50 +00:00
junv 381e7a760c github action fix 2021-10-13 23:10:55 +11:00
3 changed files with 12 additions and 11 deletions
+8 -7
View File
@@ -13,6 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
-
name: Update APP VERSION
if: contains(github.ref, '/tags/v')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo $VERSION > APP_VERSION
-
name: Prepare
id: prepare
@@ -72,12 +78,6 @@ jobs:
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
-
name: Update APP VERSION
if: contains(github.ref, '/tags/v')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo $VERSION > APP_VERSION
-
name: Commit changes
if: contains(github.ref, '/tags/v')
@@ -88,6 +88,7 @@ jobs:
message: 'Update version'
add: 'APP_VERSION'
push: true
branch: master
-
name: Update tag
if: contains(github.ref, '/tags/v')
@@ -95,7 +96,7 @@ jobs:
API_KEY: ${{ secrets.BadgeAPIKey }}
run: |
VERSION=${GITHUB_REF#refs/tags/v}
curl -XPUT -D- 'https://badges.toozhao.com/val/aria2-ui-docker' \
curl --max-time 6 -XPUT -D- 'https://badges.toozhao.com/val/aria2-ui-docker' \
-H 'Content-Type: application/json' \
-H 'API_KEY': ${API_KEY} \
-d '{"value": "'${VERSION}'"}' || true
+1 -1
View File
@@ -1 +1 @@
4.8.2.2
4.9.1
+3 -3
View File
@@ -6,14 +6,14 @@ APP_VERSION=$(cat APP_VERSION)
set +e
while true; do
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Checking for new version against ${APP_VERSION} ..."
newer_version=$(curl -s https://badges.toozhao.com/val/aria2-ui-docker?version=${APP_VERSION})
if [ -z ${newer_version} ]; then
newer_version=$(curl --max-time 6 -s https://badges.toozhao.com/val/aria2-ui-docker?version=${APP_VERSION})
if [[ -z ${newer_version} ]]; then
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Failed to check new version."
sleep 86400
continue
fi
if [ ${newer_version} != ${APP_VERSION} ]; then
if [[ ${newer_version} > ${APP_VERSION} ]]; then
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Found newer Docker image version wahyd4/aria2-ui:${newer_version}, please consider to upgrade by using docker pull command to have better user experience."
# check new version daily
sleep 86400