Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化 README 样式 #12

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ updates:
schedule:
interval: 'daily'
ignore:
- dependency-name: 'python-telegram-bot'
- dependency-name: 'python-telegram-bot'
12 changes: 12 additions & 0 deletions .github/workflows/build-and-push-generic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build and push
on:
pull_request_target:
paths:
- 'README**'
- 'LICENSE'

jobs:
merge:
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Build and push FlexGet Docker images

name: Build and push
on:
push:
branches:
- 'main'
paths-ignore:
- 'README**'
- 'LICENSE'
pull_request_target:
paths-ignore:
- 'README**'
- 'LICENSE'

env:
REGISTRY_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/flexget
Expand All @@ -18,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.sha }}

- id: platforms
run: |
Expand Down Expand Up @@ -56,6 +61,10 @@ jobs:
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/download-artifact@v4
with:
name: bake-meta
Expand All @@ -73,19 +82,18 @@ jobs:
- id: bake
uses: docker/bake-action@v5
with:
source: ${{ github.server_url }}/${{ github.repository }}.git#${{ github.head_ref }}
files: |
./docker-bake.hcl
cwd:///tmp/docker-metadata-action-bake.json
targets: image
/tmp/docker-metadata-action-bake.json
targets: all
set: |
*.tags=
*.platform=${{ matrix.platform }}
*.output=type=registry,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true

- run: |
mkdir -p /tmp/digests
digest="${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}"
digest="${{ fromJSON(steps.bake.outputs.metadata).all['containerimage.digest'] }}"
touch "/tmp/digests/${digest#sha256:}"

- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -127,4 +135,4 @@ jobs:
run: |
docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags |
map(select(startswith("${{ env.REGISTRY_IMAGE }}") or startswith("${{ env.GHCR_IMAGE }}")) | "-t " + .) |
join(" ")' /tmp/docker-metadata-action-bake.json) $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
join(" ")' /tmp/docker-metadata-action-bake.json) $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# To use the workflow, make sure you have completed the following steps in repository settings:
# 1. Create a ruleset for 'main' branch: status check 'merge' is required.
# 2. Enable 'Allow auto-merge' in 'General'.
# Without above steps, the workflow enables Dependabot pull requests to be merged unconditionally.

name: Dependabot auto-merge
# Uncomment the next line to enable the workflow.
# on: pull_request

permissions:
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto -m "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
27 changes: 27 additions & 0 deletions .github/workflows/prompt-to-pull-built-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Prompt to pull built images
on:
pull_request_target:
types: [ opened ]
paths-ignore:
- 'README**'
- 'LICENSE'

env:
REGISTRY_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/flexget

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To inspect the last successfully built Docker image based on the PR, run:
\`\`\`console
$ docker pull ${{ env.REGISTRY_IMAGE }}:pr-${{ github.event.number }}
\`\`\``
})
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ RUN set -eux; \
VOLUME /config /downloads
WORKDIR /config
EXPOSE 3539
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
13 changes: 8 additions & 5 deletions README-zh_CN.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ endif::[]
:repo: madwind/docker-flexget
:image: madwind/flexget

image:https://github.com/{repo}/actions/workflows/build-and-push-flexget-docker-images.yaml/badge.svg[CI,link=https://github.com/{repo}/actions/workflows/build-and-push-flexget-docker-images.yaml]
image:https://img.shields.io/docker/image-size/{image}?arch=arm64&logo=docker&color=aqua[Docker Image Size,link=https://registry.hub.docker.com/r/{image}]
image:https://github.com/{repo}/actions/workflows/build-and-push.yaml/badge.svg[CI,link=https://github.com/{repo}/actions/workflows/build-and-push.yaml]
image:https://img.shields.io/docker/image-size/{image}?arch=arm64&logo=docker&logoColor=aqua&color=aqua[Docker Image Size,link=https://registry.hub.docker.com/r/{image}]
image:https://badgen.net/docker/pulls/{image}?icon=docker&color=pink[Downloads,link=https://registry.hub.docker.com/r/{image}]
image:https://img.shields.io/endpoint?url=https%3A%2F%2Fmogyo.ro%2Fquart-apis%2Ftgmembercount%3Fchat_id%3Dflexget_qbittorrent_mod[Telegram Group,link=https://t.me/flexget_qbittorrent_mod]

link:README.adoc[English]

Expand Down Expand Up @@ -78,6 +79,8 @@ services:

=== 使用 GitHub Actions 构建

. https://github.com/{repo}/fork[分叉]存储库。
. 在 repository settings -> secrets and variables -> actions -> repository secrets,输入 DOCKERHUB_USERNAME 和 DOCKERHUB_TOKEN。
. git push 到 `main` 分支将自动构建并推送 Docker 映像。
. https://github.com/{repo}/fork[复刻]存储库。
. 在 repository settings -> secrets and variables -> actions -> repository secrets,输入 `DOCKERHUB_USERNAME` 和 `DOCKERHUB_TOKEN`。
. 为你的存储库启用 Actions。
因你的存储库在复刻时包含工作流,GitHub 禁止其在复刻上运行。footnote:[Dependabot 同样默认不会在复刻中启用,在 repository insights -> dependency graph -> dependabot 中启用它。]
. git push 到 `main` 分支将自动构建并推送 Docker 映像。footnote:[README 和 LICENSE 文件在排除列表中,对它们的更改不会触发构建。]
11 changes: 7 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ endif::[]
:repo: madwind/docker-flexget
:image: madwind/flexget

image:https://github.com/{repo}/actions/workflows/build-and-push-flexget-docker-images.yaml/badge.svg[CI,link=https://github.com/{repo}/actions/workflows/build-and-push-flexget-docker-images.yaml]
image:https://img.shields.io/docker/image-size/{image}?arch=arm64&logo=docker&color=aqua[Docker Image Size,link=https://registry.hub.docker.com/r/{image}]
image:https://github.com/{repo}/actions/workflows/build-and-push.yaml/badge.svg[CI,link=https://github.com/{repo}/actions/workflows/build-and-push.yaml]
image:https://img.shields.io/docker/image-size/{image}?arch=arm64&logo=docker&logoColor=aqua&color=aqua[Docker Image Size,link=https://registry.hub.docker.com/r/{image}]
image:https://badgen.net/docker/pulls/{image}?icon=docker&color=pink[Downloads,link=https://registry.hub.docker.com/r/{image}]
image:https://img.shields.io/endpoint?url=https%3A%2F%2Fmogyo.ro%2Fquart-apis%2Ftgmembercount%3Fchat_id%3Dflexget_qbittorrent_mod[Telegram Group,link=https://t.me/flexget_qbittorrent_mod]

link:README-zh_CN.adoc[简体中文]

Expand Down Expand Up @@ -79,5 +80,7 @@ To build the FlexGet Docker image locally, in the project directory, run:
=== Build with GitHub Actions

. https://github.com/{repo}/fork[Fork] the repository.
. In repository settings -> secrets and variables -> actions -> repository secrets, enter DOCKERHUB_USERNAME and DOCKERHUB_TOKEN.
. A git push to the `main` branch will automatically build and push the Docker image.
. In repository settings -> secrets and variables -> actions -> repository secrets, enter `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN`.
. Enable Actions on your repository.
Because your repository contains workflow files when it is forked, GitHub disables them from running on your fork.footnote:[Dependabot is also not enabled on forks by default. Enable it in repository insights -> dependency graph -> dependabot.]
. A git push to the `main` branch will automatically build and push the Docker image.footnote:[README and LICENSE files are in the exclusion list, changes to them will not trigger a build.]
16 changes: 5 additions & 11 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,21 @@ variable "DEFAULT_TAG" {
default = "flexget:latest"
}

target "docker-metadata-action" {
tags = ["${DEFAULT_TAG}"]
}

group "default" {
targets = ["local"]
}

target "image" {
inherits = ["docker-metadata-action"]
}

target "local" {
inherits = ["image"]
tags = ["${DEFAULT_TAG}"]
output = ["type=docker"]
}

target "docker-metadata-action" {}

target "all" {
inherits = ["image"]
inherits = ["docker-metadata-action"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ fuzzywuzzy==0.18.0
python-levenshtein==0.26.0
transmission-rpc==7.0.11
deluge-client==1.10.2
flexget==3.11.49
flexget==3.11.49
2 changes: 1 addition & 1 deletion root/defaults/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ web_server:
tasks:
example-task:
rss: http://example.com/feed.xml
download: /downloads
download: /downloads
2 changes: 1 addition & 1 deletion root/usr/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ fi
chown -R flexget:flexget /config
chown -R flexget:flexget /downloads

su flexget -c "/usr/local/bin/flexget -c /config/config.yml -l ${FG_LOGFILE:-flexget.log} -L ${FG_LOG_LEVEL:-info} daemon start --autoreload-config"
su flexget -c "/usr/local/bin/flexget -c /config/config.yml -l ${FG_LOGFILE:-flexget.log} -L ${FG_LOG_LEVEL:-info} daemon start --autoreload-config"
Loading