Merge pull request #17 from mogeko:dev

enable compile manually
This commit is contained in:
Mogeko 2021-11-18 19:39:42 +01:00 committed by GitHub
commit da7771a32a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 14 deletions

View file

@ -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

View file

@ -1,6 +1,6 @@
# docker-qbittorrent # docker-qbittorrent
[![ci_icon]][ci_link] [![image_size]][docker_link] [![ci_icon]][ci_link] [![image_size]][docker_link] [![image_ver]][docker_link]
Docker image for qBittorrent. Docker image for qBittorrent.
@ -8,6 +8,7 @@ Docker image for qBittorrent.
- Enable rootless[^1] - Enable rootless[^1]
- Enable `QBT_*` options[^2] - Enable `QBT_*` options[^2]
- Keep updating - Keep updating
- Compile by `clang`
## Usage ## Usage
@ -91,6 +92,7 @@ The code in this project is released under the [GPL-3.0 License][license].
[ci_icon]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml/badge.svg [ci_icon]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml/badge.svg
[ci_link]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml [ci_link]: https://github.com/mogeko/docker-qbittorrent/actions/workflows/auto-update.yml
[image_size]: https://img.shields.io/docker/image-size/mogeko/qbittorrent?logo=docker [image_size]: https://img.shields.io/docker/image-size/mogeko/qbittorrent?logo=docker
[image_ver]: https://img.shields.io/docker/v/mogeko/qbittorrent?logo=docker
[docker_link]: https://hub.docker.com/r/mogeko/qbittorrent [docker_link]: https://hub.docker.com/r/mogeko/qbittorrent
<!-- links --> <!-- links -->