build(ci): enable compile manually
This commit is contained in:
parent
c7ad5fa907
commit
3b3886eec0
1 changed files with 28 additions and 13 deletions
41
.github/workflows/auto-update.yml
vendored
41
.github/workflows/auto-update.yml
vendored
|
|
@ -1,6 +1,9 @@
|
||||||
name: update-bot
|
name: update-bot
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 23 * * *'
|
- cron: '30 23 * * *'
|
||||||
|
|
||||||
|
|
@ -8,27 +11,39 @@ jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
old_ver: ${{ steps.check_ver.outputs.old_ver }}
|
is_new: ${{ steps.check_ver.outputs.is_new }}
|
||||||
new_ver: ${{ steps.check_ver.outputs.new_ver }}
|
qbt_ver: ${{ steps.check_ver.outputs.qbt_ver }}
|
||||||
|
lib_ver: ${{ steps.check_ver.outputs.lib_ver }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
run: |
|
run: |
|
||||||
OLD_TAG=$(curl -s "${GHCO_URL}" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
|
||||||
NEW_TAG=$(curl -s "${REPO_TAGS}" | grep -Po "release-(\d+\.){2}\d+\.zip" | head -1)
|
NEW_TAG=$(curl -s "${REPO_TAGS}" | grep -Po "release-(\d+\.){2}\d+\.zip" | head -1)
|
||||||
echo "::set-output name=old_ver::${OLD_TAG:0:5}"
|
LIB_VER=$(jq -r '.libtorrent' ./latest.json)
|
||||||
echo "::set-output name=new_ver::${NEW_TAG:8:5}"
|
QBT_VER=$(jq -r '.qbittorrent' ./latest.json)
|
||||||
|
PKG_REL=$(jq -r '.pkgrel' ./latest.json)
|
||||||
|
if [ ${{ github.event_name }} == 'push' ]; then
|
||||||
|
echo "::set-output name=qbt_ver::${QBT_VER}-r${PKG_REL}"
|
||||||
|
echo "::set-output name=is_new::yes"
|
||||||
|
elif [ "${NEW_TAG:8:5}" != "${QBT_VER}" ]; then
|
||||||
|
echo "::set-output name=qbt_ver::${NEW_TAG:8:5}-r0"
|
||||||
|
echo "::set-output name=is_new::yes"
|
||||||
|
else
|
||||||
|
echo "::set-output name=is_new::no"
|
||||||
|
fi
|
||||||
|
echo "::set-output name=lib_ver::${LIB_VER}"
|
||||||
env:
|
env:
|
||||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
|
||||||
REPO_TAGS: https://github.com/qbittorrent/qBittorrent/tags
|
REPO_TAGS: https://github.com/qbittorrent/qBittorrent/tags
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
if: ${{ needs.check.outputs.old_ver != needs.check.outputs.new_ver }}
|
if: ${{ needs.check.outputs.is_new == 'yes' }}
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
@ -58,7 +73,7 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
type=edge
|
type=edge
|
||||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
type=raw,${{ needs.check.outputs.new_ver }}
|
type=raw,${{ needs.check.outputs.qbt_ver }}
|
||||||
type=raw,latest
|
type=raw,latest
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
|
|
@ -70,8 +85,8 @@ jobs:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
QBITTORRENT_VERSION=${{ needs.check.outputs.new_ver }}-r0
|
QBITTORRENT_VERSION=${{ needs.check.outputs.qbt_ver }}
|
||||||
LIBTORRENT_VERSION=1.2.14
|
LIBTORRENT_VERSION=${{ needs.check.outputs.lib_ver }}
|
||||||
|
|
||||||
- name: Save metadata
|
- name: Save metadata
|
||||||
run: echo ${{ toJSON(steps.build.outputs.metadata) }} > ${{ github.workspace }}/meta.json
|
run: echo ${{ toJSON(steps.build.outputs.metadata) }} > ${{ github.workspace }}/meta.json
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue