pull file
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
Close Stale Issues / close_stale_issues (push) Has been cancelled
repo-sync / repo-sync (push) Has been cancelled
auto-deploy-tencent-scf / pre-check (push) Has been cancelled
auto-deploy-tencent-scf / deploy serverless (push) Has been cancelled

This commit is contained in:
2026-02-11 23:32:56 +08:00
commit e519cac94e
656 changed files with 45058 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
# https://github.com/June1991/serverless-express
name: auto-deploy-tencent-scf
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 1,3,5" # 每周一、三、五的10点
env:
IsAutoDeployTencentScf: ${{ secrets.IS_AUTO_DEPLOY_TENCENT_SCF }} # 是否开启自动部署云函数
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.check.outputs.result }} # 不能直接传递secrets的值否则会被skip需要转一下
steps:
- id: check
run: |
[ ${{ github.event_name }} == 'workflow_dispatch' -o true == "${{ env.IsAutoDeployTencentScf }}" ] && echo "result=开启" >> $GITHUB_OUTPUT || echo "result=关闭" >> $GITHUB_OUTPUT
deploy:
name: deploy serverless
runs-on: ubuntu-latest
needs: pre-check
# if: env.IsAutoDeployTencentScf=='true' # 这里job.if读取不到env或secrets很坑...但是发现可以读到needs的outputs值
if: needs.pre-check.outputs.result=='开启'
steps:
- name: clone local repository
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: install serverless
run: npm i -g serverless-cloud-framework
- name: deploy serverless
run: |
cd ./tencentScf
echo "开始配置云函数:"
echo "$Tencent_Serverless_Yml"
[ -z "$Tencent_Serverless_Yml" ] && echo "未配置serverless.yml使用默认值" || echo "$Tencent_Serverless_Yml" > serverless.yml
echo "开始发布项目"
chmod +x publish.sh
./publish.sh
echo "开始部署到云函数"
scf deploy
env: # 环境变量
STAGE: dev #您的部署环境
SERVERLESS_PLATFORM_VENDOR: tencent # serverless海外默认为aws部署配置为腾讯部署
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }} # 您的腾讯云账号sercret ID
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }} # 您的腾讯云账号sercret key
Tencent_Serverless_Yml: ${{ secrets.TENCENT_SERVERLESS_YML }} # 云函数配置(区域、环境变量、触发器等)

78
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ main, develop, release/* ]
paths:
- '**/*.js'
- '**/*.cs'
- '**/*.cshtml'
- '**/*.csproj'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, develop ]
paths:
- '**/*.js'
- '**/*.cs'
- '**/*.cshtml'
- '**/*.csproj'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

13
.github/workflows/no-toxic-comments.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Check Toxic Comments
on: [issue_comment, pull_request_review]
jobs:
toxic_check:
runs-on: ubuntu-latest
name: Safe space
steps:
- uses: actions/checkout@v2
- name: Safe space - action step
uses: charliegerard/safe-space@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

87
.github/workflows/publish-image.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: Publish image
on:
workflow_dispatch:
inputs:
autoWithLatestTag:
description: 'Auto Add Latest Tag'
required: true
default: true
type: boolean
release:
types: [created]
env:
DOCKERHUB_USERNAME : ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD : ${{ secrets.DOCKERHUB_PASSWORD }}
GHCR_USERNAME: ${{ github.repository_owner }}
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_IMG_NAME: "zai7lou/bili_tool_web"
GHC_IMG_NAME: "ghcr.io/raywangqvq/bili_tool_web"
jobs:
PublishImage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: GetTargetVersion
id: getTargetVersion
run: |
TargetVersion=""
if [ "${{ github.event.release.tag_name }}" ] ; then
TargetVersion=${{ github.event.release.tag_name }}
else
TargetVersion=$(grep -oP '(?<=<Version>).*?(?=<\/Version>)' ./common.props)
fi
echo "TargetVersion: $TargetVersion"
echo "TargetVersion=$TargetVersion" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_PASSWORD }}
- name: Log in to ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ env.GHCR_USERNAME }}
password: ${{ env.GHCR_PASSWORD }}
- name: Generate tags
id: tags
run: |
targetVersion="${{ steps.getTargetVersion.outputs.TargetVersion }}"
dockerTagWithVersion="${{ env.DOCKER_IMG_NAME }}:$targetVersion"
ghcrTagWithVersion="${{ env.GHC_IMG_NAME }}:$targetVersion"
dockerTagWithLatest=""
ghcrTagWithLatest=""
if [ "${{ github.event.inputs.autoWithLatestTag }}" == "true" ] || [ ${{ github.event.release.created_at }} ]; then
dockerTagWithLatest="${{ env.DOCKER_IMG_NAME }}:latest"
ghcrTagWithLatest="${{ env.GHC_IMG_NAME }}:latest"
fi
echo "dockerTagWithVersion=$dockerTagWithVersion" >> $GITHUB_OUTPUT
echo "ghcrTagWithVersion=$ghcrTagWithVersion" >> $GITHUB_OUTPUT
echo "dockerTagWithLatest=$dockerTagWithLatest" >> $GITHUB_OUTPUT
echo "ghcrTagWithLatest=$ghcrTagWithLatest" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.tags.outputs.dockerTagWithVersion }}
${{ steps.tags.outputs.ghcrTagWithVersion }}
${{ steps.tags.outputs.dockerTagWithLatest }}
${{ steps.tags.outputs.ghcrTagWithLatest }}

45
.github/workflows/publish-release.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Publish release
on:
workflow_dispatch:
permissions:
contents: write
discussions: write
jobs:
build:
name: Publish Release
if: ${{ github.repository == 'RayWangQvQ/BiliBiliToolPro' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Publish and Zip Release
run: |
cd ./scripts
chmod +x ./publish.sh
./publish.sh --runtime all
- name: Read Version
id: version
run: echo "version=$(cat ./src/Ray.BiliBiliTool.Console/bin/Publish/version.txt)" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: './src/Ray.BiliBiliTool.Console/bin/Publish/*.zip'
token: ${{ secrets.GITHUB_TOKEN }}
name: "BiliBiliToolPro-V${{ steps.version.outputs.version }}"
tag_name: ${{ steps.version.outputs.version }}
body_path: './src/Ray.BiliBiliTool.Console/bin/Publish/release_notes.md'
discussion_category_name: Announcements
generate_release_notes: true
fail_on_unmatched_files: true

28
.github/workflows/repo-sync.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
# 自动同步上游仓库
name: repo-sync
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 1,3,5'
# UTC时区比我们东八区早8小时上面示例为每周一、三、五的9点。
jobs:
repo-sync:
if: ${{ github.repository != 'RayWangQvQ/BiliBiliToolPro' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: repo-sync
uses: repo-sync/github-sync@v2
with:
source_repo: "https://github.com/RayWangQvQ/BiliBiliToolPro.git"
source_branch: "main"
destination_branch: "main"
sync_tags: "true"
github_token: ${{ secrets.PAT }}

25
.github/workflows/stale-issues.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Close Stale Issues
on:
schedule:
- cron: "0 8 * * *" # 每天的 00:00 运行
workflow_dispatch:
permissions:
contents: read
issues: write
pull-requests: write
jobs:
close_stale_issues:
runs-on: ubuntu-latest
steps:
- name: Close Stale Issues
uses: actions/stale@v5
with:
days-before-stale: 3 # 3 天不活跃后标记Stale
days-before-close: 3 # 标记Stale后3天不活跃则关闭问题
stale-issue-label: "Stale" # 标记为 "Stale" 的问题
stale-issue-message: "🕸️ This has been inactive for 3 days, please confirm if it still needs attention~~" # Comment added
close-issue-message: "🚫 This has been inactive for too long and is now closed, feel free to reopen it if needed!" # Comment added
only-labels: "needs-more-info" # 只处理标签为 "help wanted" 的问题
repo-token: ${{ secrets.GITHUB_TOKEN }}

30
.github/workflows/tag.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Tag
on:
pull_request:
types:
- closed
branches:
- main
jobs:
tag:
name: add tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get current version
id: current_version
run: |
version=$(grep -oP '(?<=<Version>).*?(?=<\/Version>)' ./common.props)
echo "Curent version: $version"
echo "current_version=$version" >> $GITHUB_OUTPUT
- name: Tag and push
run: |
new_tag="${{ steps.current_version.outputs.current_version }}"
git tag -f "$new_tag"
git push -f origin "$new_tag"

19
.github/workflows/verify-pr.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: VerifyPR
on:
pull_request_target:
types: [opened, edited]
jobs:
checkTargetBranch:
runs-on: ubuntu-latest
steps:
- uses: Vankka/pr-target-branch-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: main
change-to: develop
exclude: RayWangQvQ/BiliBiliToolPro:develop
comment: |
Your PR was set to `main`, but PRs should be sent to `develop`
The base branch of this PR has been automatically changed to `develop`, please check that there are no merge conflicts.