build: simplified check logic
This commit is contained in:
parent
19bd946047
commit
edcee500eb
2 changed files with 13 additions and 21 deletions
18
.github/workflows/auto-update.yml
vendored
18
.github/workflows/auto-update.yml
vendored
|
|
@ -2,18 +2,18 @@ name: update-bot
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 20 * * *'
|
- cron: '00 23 * * *'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: mogeko/qbittorrent
|
IMAGE_NAME: ${{ github.repository_owner }}/qbittorrent
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
is_new: ${{ steps.check_ver.outputs.is_new }}
|
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
||||||
version: ${{ steps.check_ver.outputs.version }}
|
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
|
|
@ -21,12 +21,8 @@ jobs:
|
||||||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||||
OLD_VER=$(get_ver ${GHCO_URL})
|
OLD_VER=$(get_ver ${GHCO_URL})
|
||||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
||||||
if [ "$NEW_VER" != "$OLD_VER" ]; then
|
echo "::set-output name=old_ver::${OLD_VER}"
|
||||||
echo "::set-output name=is_new::true"
|
echo "::set-output name=new_ver::${NEW_VER}"
|
||||||
else
|
|
||||||
echo "::set-output name=is_new::false"
|
|
||||||
fi
|
|
||||||
echo "::set-output name=version::${NEW_VER}"
|
|
||||||
env:
|
env:
|
||||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
||||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
||||||
|
|
@ -34,7 +30,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
if: ${{ needs.check.outputs.is_new }}
|
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
|
||||||
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
|
|
@ -10,14 +10,14 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: mogeko/qbittorrent
|
IMAGE_NAME: ${{ github.repository_owner }}/qbittorrent
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
is_new: ${{ steps.check_ver.outputs.is_new }}
|
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
||||||
version: ${{ steps.check_ver.outputs.version }}
|
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
|
|
@ -25,12 +25,8 @@ jobs:
|
||||||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||||
OLD_VER=$(get_ver ${GHCO_URL})
|
OLD_VER=$(get_ver ${GHCO_URL})
|
||||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
||||||
if [ "$NEW_VER" != "$OLD_VER" ]; then
|
echo "::set-output name=old_ver::${OLD_VER}"
|
||||||
echo "::set-output name=is_new::true"
|
echo "::set-output name=new_ver::${NEW_VER}"
|
||||||
else
|
|
||||||
echo "::set-output name=is_new::false"
|
|
||||||
fi
|
|
||||||
echo "::set-output name=version::${NEW_VER}"
|
|
||||||
env:
|
env:
|
||||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
||||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
||||||
|
|
@ -38,7 +34,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
if: ${{ needs.check.outputs.is_new }}
|
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue