Files
BiliBiliToolPro/gitHubActions/bak/live-lottery-task.yml
database-mysql e519cac94e
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
pull file
2026-02-11 23:32:56 +08:00

102 lines
4.6 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 天选时刻抽奖任务
name: live-lottery-task
on:
workflow_dispatch: # 手动触发
schedule: # 计划任务触发
- cron: '0 16 * * *'
# cron表达式时区是UTC时间比我们早8小时如上所表示的是每天0点0分24点整
# 建议每个人通过设置名称为 LiveLottery 的 GitHub Environments 来设定为自己的目标运行时间(详细设置方法见文档说明)
env:
IsOpenLiveLotteryTask: ${{secrets.ISOPENLIVELOTTERYTASK}} #是否开启该GitHub工作流
ASPNETCORE_ENVIRONMENT: ${{secrets.ENV}} # 运行环境
Ray_CloseConsoleWhenEnd: 1
Ray_BiliBiliCookies__1: ${{secrets.COOKIESTR}}
Ray_BiliBiliCookies__2: ${{secrets.COOKIESTR2}}
Ray_BiliBiliCookies__3: ${{secrets.COOKIESTR3}}
# 天选任务:
Ray_LiveLotteryTaskConfig__ExcludeAwardNames: ${{secrets.EXCLUDEAWARDNAMES}} # 天选抽奖指定排除关键字
Ray_LiveLotteryTaskConfig__IncludeAwardNames: ${{secrets.INCLUDEAWARDNAMES}} # 天选抽奖指定包含关键字
Ray_LiveLotteryTaskConfig__AutoGroupFollowings: ${{secrets.AUTOGROUPFOLLOWINGS}} # 抽奖结束后是否将关注主播自动分组
Ray_LiveLotteryTaskConfig__DenyUids: ${{secrets.LIVELOTTERYDENYUIDS}} # 天选筹抽奖主播Uid黑名单
# 推送:
Ray_Serilog__WriteTo__3__Args__botToken: ${{secrets.PUSHTGTOKEN}} # Telegram
Ray_Serilog__WriteTo__3__Args__chatId: ${{secrets.PUSHTGCHATID}}
Ray_Serilog__WriteTo__3__Args__restrictedToMinimumLevel: ${{secrets.PUSHTGLEVEL}}
Ray_Serilog__WriteTo__4__Args__webHookUrl: ${{secrets.PUSHWEIXINURL}} # 企业微信
Ray_Serilog__WriteTo__4__Args__restrictedToMinimumLevel: ${{secrets.PUSHWEIXINLEVEL}}
Ray_Serilog__WriteTo__5__Args__webHookUrl: ${{secrets.PUSHDINGURL}} # 钉钉
Ray_Serilog__WriteTo__5__Args__restrictedToMinimumLevel: ${{secrets.PUSHDINGLEVEL}}
Ray_Serilog__WriteTo__6__Args__scKey: ${{secrets.PUSHSCKEY}} # Server酱
Ray_Serilog__WriteTo__6__Args__turboScKey: ${{secrets.PUSHSERVERTSCKEY}}
Ray_Serilog__WriteTo__6__Args__restrictedToMinimumLevel: ${{secrets.PUSHSERVERLEVEL}}
Ray_Serilog__WriteTo__7__Args__sKey: ${{secrets.PUSHCOOLSKEY}} # 酷推
Ray_Serilog__WriteTo__7__Args__restrictedToMinimumLevel: ${{secrets.PUSHCOOLLEVEL}}
Ray_Serilog__WriteTo__8__Args__api: ${{secrets.PUSHOTHERAPI}} # 自定义api
Ray_Serilog__WriteTo__8__Args__placeholder: ${{secrets.PUSHOTHERPLACEHOLDER}}
Ray_Serilog__WriteTo__8__Args__bodyJsonTemplate: ${{secrets.PUSHOTHERBODYJSONTEMPLATE}}
Ray_Serilog__WriteTo__8__Args__restrictedToMinimumLevel: ${{secrets.PUSHOTHERLEVEL}}
Ray_Serilog__WriteTo__9__Args__token: ${{secrets.PUSHPLUSTOKEN}} # PushPlus
Ray_Serilog__WriteTo__9__Args__topic: ${{secrets.PUSHPLUSTOPIC}}
Ray_Serilog__WriteTo__9__Args__channel: ${{secrets.PUSHPLUSCHANNEL}}
Ray_Serilog__WriteTo__9__Args__webhook: ${{secrets.PUSHPLUSWEBHOOK}}
Ray_Serilog__WriteTo__9__Args__restrictedToMinimumLevel: ${{secrets.PUSHPLUSLEVEL}}
# 安全相关:
Ray_Security__IsSkipDailyTask: ${{secrets.ISSKIPDAILYTASK}}
Ray_Security__IntervalSecondsBetweenRequestApi: ${{secrets.INTERVALSECONDSBETWEENREQUESTAPI}}
Ray_Security__IntervalMethodTypes: ${{secrets.INTERVALMETHODTYPES}}
Ray_Security__UserAgent: ${{secrets.USERAGENT}}
Ray_Security__WebProxy: ${{secrets.WEBPROXY}}
Ray_Security__RandomSleepMaxMin: ${{secrets.RANDOMSLEEPMAXMIN}}
# Console日志
Ray_Serilog__WriteTo__0__Args__restrictedToMinimumLevel: ${{secrets.CONSOLELOGLEVEL}}
Ray_Serilog__WriteTo__0__Args__outputTemplate: ${{secrets.CONSOLELOGTEMPLATE}}
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.check.outputs.result }} # 不能直接传递secrets的值否则会被skip需要转一下
steps:
- id: check
if: env.IsOpenLiveLotteryTask=='true'
run: |
echo "::set-output name=result::开启"
run-live-lottery:
runs-on: ubuntu-latest
needs: pre-check
# if: env.IsOpenLiveLotteryTask=='true' # 这里job.if读取不到env或secrets很坑...但是发现可以读到needs的outputs值
if: needs.pre-check.outputs.result=='开启'
environment: LiveLottery
steps:
# 输出IP、设置服务器时区为东八区
- name: PreWork
run: |
sudo curl ifconfig.me
sudo timedatectl set-timezone 'Asia/Shanghai'
# 检出
- name: Checkout
uses: actions/checkout@v2
# .Net 环境
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
# 测试运行
- name: Test APP
run: |
cd ./src/Ray.BiliBiliTool.Console
dotnet run --runTasks=LiveLottery