From 7c71c854947d16f02052e1c3fa3fd4ee82e8452b Mon Sep 17 00:00:00 2001 From: JasonYANG17 <39414350+JasonYANG170@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:33:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(pusher):=20=E5=8A=A0=E5=85=A5pushplus?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20(#250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create SourceGit.yaml * Automated deployment @ 2024-02-26 14:48:13 Asia/Shanghai * Automated deployment @ 2024-02-27 06:28:04 Asia/Shanghai * Automated deployment @ 2024-02-28 06:28:07 Asia/Shanghai * ADD PUSHPLUS * Update SourceGit.yaml * Automated deployment @ 2024-02-28 14:36:53 Asia/Shanghai * Update SourceGit.yaml * Automated deployment @ 2024-02-28 14:46:01 Asia/Shanghai * Update PUSHPLUS.py * Automated deployment @ 2024-02-28 14:54:28 Asia/Shanghai * Automated deployment @ 2024-02-29 06:26:18 Asia/Shanghai --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/SourceGit.yaml | 53 ++++++++++++++++++++++++++++++++ PUSHPLUS.py | 7 +++++ _token | 1 + 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/SourceGit.yaml create mode 100644 PUSHPLUS.py create mode 100644 _token diff --git a/.github/workflows/SourceGit.yaml b/.github/workflows/SourceGit.yaml new file mode 100644 index 0000000..4a5fefd --- /dev/null +++ b/.github/workflows/SourceGit.yaml @@ -0,0 +1,53 @@ +name: Claim EpicGames from SourceGit + +on: + workflow_dispatch: + schedule: + - cron: "12 22 * * *" + +jobs: + setup: + env: + EPIC_EMAIL: ${{ secrets.EPIC_EMAIL }} + TOKEN: ${{ secrets.PUSHTOKEN }} + EPIC_PASSWORD: ${{ secrets.EPIC_PASSWORD }} + FAKE_HASH: "Automated deployment @ $(date '+%Y-%m-%d %H:%M:%S') Asia/Shanghai" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 初始化环境 & 拉取项目 + run: | + sudo timedatectl set-timezone "Asia/Shanghai" + git clone https://github.com/QIN2DIM/epic-awesome-gamer.git epic + cp epic/requirements.txt . + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: 'pip' # caching pip dependencies + - name: 安装依赖 + run: | + pip install -r epic/requirements.txt + pip install requests + playwright install firefox + playwright install-deps firefox + - name: 启动项目 + continue-on-error: true + timeout-minutes: 10 + run: | + if [ -d "user_data_dir" ];then cp -rfp user_data_dir epic/; fi + echo "{}" > epic/src/config.json + cd epic/src/ && python3 claim.py + - name: Setup GIT user + uses: fregante/setup-git-user@v1 + - name: 缓存身份令牌 + run: | + if [ -d "epic/user_data_dir" ];then cp -rfp epic/user_data_dir . ; fi + if [ -d "epic/logs" ];then cp -rfp epic/logs . ; fi + echo "${{ env.FAKE_HASH }}" > _token + rm -rf epic + git add . + git commit -m "${{ env.FAKE_HASH }}" + git push -f + - name: PUSHPLUS + run: | + python PUSHPLUS.py diff --git a/PUSHPLUS.py b/PUSHPLUS.py new file mode 100644 index 0000000..b2ab1ea --- /dev/null +++ b/PUSHPLUS.py @@ -0,0 +1,7 @@ +import requests +import os +token = os.environ['TOKEN'] +title= 'Epic-FreeGamer' +content ='Epic-FreeGamer任务已执行' +url = 'http://www.pushplus.plus/send?token='+token+'&title='+title+'&content='+content +requests.get(url) diff --git a/_token b/_token new file mode 100644 index 0000000..605a279 --- /dev/null +++ b/_token @@ -0,0 +1 @@ +Automated deployment @ 2024-02-29 06:26:18 Asia/Shanghai