初始化 telegram-downloader 并接入群晖 CI/CD
部署到群晖 / deploy (push) Failing after 10m45s

This commit is contained in:
yuming
2026-04-22 21:29:03 +08:00
commit cf40343c51
153 changed files with 33376 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
name: 🐞 Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: telegram_media_downloader-version
attributes:
label: telegram_media_downloader version or commit
description: What version of our software are you running?
placeholder: ex. v2.1.5 or 550a063a7fad8723220d8681687d2363cb838d7c
validations:
required: true
- type: dropdown
id: OS
attributes:
label: What OS are you seeing the problem on?
multiple: true
options:
- Mac
- Windows
- Other Linux Distro
validations:
required: false
- type: input
id: python-version
attributes:
label: Python Version
description: What version of python are you running?
placeholder: ex. 3.7.1
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you expected to happen!
validations:
required: true
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: Also tell us, what is currently happening?
placeholder: Tell us what is happening now.
validations:
required: true
- type: textarea
id: possible-solution
attributes:
label: Possible Solution
description: Do you have a solution for the issue?
placeholder: Tell us what the solution could look like.
validations:
required: false
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to Reproduce
description: Tell us how to reproduce the issue?
placeholder: Tell us how to reproduce the issue?
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
+91
View File
@@ -0,0 +1,91 @@
name: 🐞 Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: opencommit-version
attributes:
label: Opencommit Version
description: What version of our software are you running?
placeholder: ex. 1.1.22
validations:
required: true
- type: input
id: node-version
attributes:
label: Node Version
description: What version of node are you running?
placeholder: ex. 19.8.1
validations:
required: true
- type: input
id: npm-version
attributes:
label: NPM Version
description: What version of npm are you running?
placeholder: ex. 9.6.2
validations:
required: true
- type: dropdown
id: OS
attributes:
label: What OS are you seeing the problem on?
multiple: true
options:
- Mac
- Windows
- Other Linux Distro
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you expected to happen!
validations:
required: true
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: Also tell us, what is currently happening?
placeholder: Tell us what is happening now.
validations:
required: true
- type: textarea
id: possible-solution
attributes:
label: Possible Solution
description: Do you have a solution for the issue?
placeholder: Tell us what the solution could look like.
validations:
required: false
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to Reproduce
description: Tell us how to reproduce the issue?
placeholder: Tell us how to reproduce the issue?
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
@@ -0,0 +1,20 @@
---
name: Documentation Improvement
about: Report wrong or missing documentation.
title: 'DOC:'
labels: ''
assignees: ''
---
#### Location of the documentation
[this should provide the location of the documentation, e.g. "CONTRIBUTION.md" or the URL of the documentation, e.g. "https://github.com/tangyoha/telegram_media_downloader/blob/master/CONTRIBUTING.md"]
#### Documentation problem
[this should provide a description of what documentation you believe needs to be fixed/improved]
#### Suggested fix for documentation
[this should explain the suggested fix and **why** it's better than the existing documentation]
@@ -0,0 +1,48 @@
---
name: 🛠️ Feature Request
description: Suggest an idea to help us improve Opencommit
title: "[Feature]: "
labels:
- "feature_request"
body:
- type: markdown
attributes:
value: |
**Thanks :heart: for taking the time to fill out this feature request report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/di-sukharev/opencommit/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature.
We are also happy to accept contributions from our users. For more details see [here](https://github.com/di-sukharev/opencommit/blob/master/.github/CONTRIBUTING.md).
- type: textarea
attributes:
label: Description
description: |
A clear and concise description of the feature you're interested in.
validations:
required: true
- type: textarea
attributes:
label: Suggested Solution
description: |
Describe the solution you'd like. A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you've considered.
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
+48
View File
@@ -0,0 +1,48 @@
---
name: 🛠️ Feature Request
description: Suggest an idea to help us improve Opencommit
title: "[Feature]: "
labels:
- "feature_request"
body:
- type: markdown
attributes:
value: |
**Thanks :heart: for taking the time to fill out this feature request report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/di-sukharev/opencommit/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature.
We are also happy to accept contributions from our users. For more details see [here](https://github.com/di-sukharev/opencommit/blob/master/.github/CONTRIBUTING.md).
- type: textarea
attributes:
label: Description
description: |
A clear and concise description of the feature you're interested in.
validations:
required: true
- type: textarea
attributes:
label: Suggested Solution
description: |
Describe the solution you'd like. A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you've considered.
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
+11
View File
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "12:00"
timezone: CET
open-pull-requests-limit: 10
reviewers:
- tangyoha
+4
View File
@@ -0,0 +1,4 @@
label-alias:
bug: 'kind/bug'
feature_request: 'enhancement'
question: 'question'
+22
View File
@@ -0,0 +1,22 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- enhancement
- feature_request
- help wanted
- good first issue
- dependencies
- bug
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity in the past 45 days. It will be closed if no further activity
occurs in the next 7 days. Thank you for your contributions.
# Limit to only `issues`
only: issues
+24
View File
@@ -0,0 +1,24 @@
name: Code Quality
on:
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
push:
branches: [ master ]
paths-ignore:
- 'README.md'
jobs:
pre-commit:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.8'
- name: Install dependencies
run: make dev_install
- uses: pre-commit/action@v3.0.0
@@ -0,0 +1,123 @@
name: Create Release and Upload Assets
on:
push:
tags:
- 'v*'
jobs:
build-tdl-binaries:
name: Build tdl binaries for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest] #[macos-latest, ubuntu-20.04, windows-latest]
include:
- os: macos-latest
TARGET: macos
- os: ubuntu-20.04
TARGET: linux-amd64
- os: windows-latest
TARGET: win64
container: ${{ matrix.CONTAINER }}
env:
DISTPATH: tdl-${{ matrix.TARGET }}
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Python 3.11
uses: actions/setup-python@master
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python3 -m pip install -r requirements.txt
python3 gen_filter_cache.py
pip install pyinstaller==6.7.0
- name: Build with PyInstaller
run: |
pyinstaller --distpath ./${{ env.DISTPATH }} media_downloader.spec
- name: Add license and readme
shell: bash
run: mv README_CN.md README.md ./${{ env.DISTPATH }}
- name: Archive artifact
uses: actions/upload-artifact@master
with:
name: ${{ env.DISTPATH }}
path: ${{ env.DISTPATH }}
# release:
# needs: build-tdl-binaries
# runs-on: ubuntu-latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Get Release Date
# id: release_date
# run: |
# RELEASE_DATE=$(date +%Y-%m-%d)
# echo "RELEASE_DATE=$RELEASE_DATE" | tee -a $GITHUB_ENV
# echo "release_date=$RELEASE_DATE" >> $GITHUB_OUTPUT
# - name: Generate changelog
# id: changelog
# run: |
# PREVIOUS_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
# CURRENT_TAG=${{ github.ref }}
# LOG=$(git log --pretty=format:'* %s by @%an in %H' $PREVIOUS_TAG...$CURRENT_TAG)
# echo "changelog=$LOG" >> $GITHUB_OUTPUT
create_release:
name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
needs: build-tdl-binaries
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }},${{ steps.release_date.outputs.release_date }}
draft: false
prerelease: false
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
upload_assets:
name: Upload release assets
if: startsWith(github.ref, 'refs/tags/')
needs: create_release
runs-on: ubuntu-latest
strategy:
matrix:
TARGET: [win64] #[macos, linux-amd64, win64]
env:
DISTPATH: tdl-${{ needs.create_release.outputs.VERSION }}-${{ matrix.TARGET }}
steps:
- name: Download built binaries
uses: actions/download-artifact@master
- name: Rename and package binaries
run: |
zip -r ${{ env.DISTPATH }}.zip ./tdl-${{ matrix.TARGET }}/*
- name: Upload release assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: "${{ env.DISTPATH }}.zip"
asset_name: "${{ env.DISTPATH }}.zip"
asset_content_type: application/zip
+80
View File
@@ -0,0 +1,80 @@
name: Docker Publish
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
build-and-push:
runs-on: ubuntu-latest
outputs:
compile_image_exists: ${{ steps.check-image.outputs.exists }}
requirements_modified: ${{ steps.check-requirements.outputs.modified }}
check-dockerfile: ${{ steps.check-dockerfile.outputs.dockerfile_modified }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Check if compile-image exists on Docker Hub
id: check-image
run: |
EXISTS=$(curl --silent --fail --head "https://hub.docker.com/v2/repositories/${{ secrets.DOCKER_HUB_USERNAME }}/telegram_media_downloader_compile/tags/latest" > /dev/null && echo "true" || echo "false")
echo "exists=$EXISTS" >> $GITHUB_ENV
echo "exists=$EXISTS" >> $GITHUB_OUTPUT
- name: Check if requirements.txt has been modified
id: check-requirements
run: |
MODIFIED=$(git diff --name-only HEAD~1 HEAD | grep -w 'requirements.txt' > /dev/null && echo "true" || echo "false")
echo "modified=$MODIFIED" >> $GITHUB_ENV
echo "modified=$MODIFIED" >> $GITHUB_OUTPUT
- name: Check if Dockerfile has been modified
id: check-dockerfile
run: |
DOCKERFILE_MODIFIED=$(git diff --name-only HEAD~1 HEAD | grep -w 'Dockerfile' > /dev/null && echo "true" || echo "false")
echo "dockerfile_modified=$DOCKERFILE_MODIFIED" >> $GITHUB_ENV
echo "dockerfile_modified=$DOCKERFILE_MODIFIED" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Print Env
id: env_aa
run: |
echo ${{ steps.check-image.outputs.exists }}
echo ${{ steps.check-requirements.outputs.modified }}
echo ${{ steps.check-dockerfile.outputs.dockerfile_modified }}
- name: Build and push compile-image
if: ${{ !(steps.check-image.outputs.exists == 'true' && steps.check-requirements.outputs.modified == 'false' && steps.check-dockerfile.outputs.dockerfile_modified == 'false') }}
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386,linux/ppc64le
target: compile-image
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/telegram_media_downloader_compile:latest
- name: Build and push runtime-image
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386,linux/ppc64le
target: runtime-image
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/telegram_media_downloader:latest
${{ secrets.DOCKER_HUB_USERNAME }}/telegram_media_downloader:${{ github.ref_name }}
+42
View File
@@ -0,0 +1,42 @@
name: Unittest
on:
push:
branches: [ master ]
paths-ignore:
- 'README.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12' ]
name: Test - Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get setuptools Unix
if: ${{ matrix.os != 'windows-latest' }}
run: python -m pip install --upgrade pip setuptools codecov
- name: Get setuptools Windows
if: ${{ matrix.os == 'windows-latest' }}
run: python -m pip install --upgrade pip setuptools codecov
- name: Install dependencies
run: make dev_install
- name: Test with pytest
run: |
make -e test
codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}