feat(pusher): 加入pushplus微信消息推送功能 (#250)

* 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>
This commit is contained in:
JasonYANG17 2024-02-29 11:33:35 +08:00 committed by GitHub
parent 891684d29a
commit 7c71c85494
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 61 additions and 0 deletions

53
.github/workflows/SourceGit.yaml vendored Normal file
View File

@ -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

7
PUSHPLUS.py Normal file
View File

@ -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)

1
_token Normal file
View File

@ -0,0 +1 @@
Automated deployment @ 2024-02-29 06:26:18 Asia/Shanghai