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