genshin-impact-helper/.github/workflows/main.yml
2021-01-05 18:02:01 +08:00

50 lines
1.3 KiB
YAML

name: "Genshin Impact Helper"
on:
schedule:
- cron: "0 22 * * *" # scheduled at 06:00 (UTC+8) everyday
workflow_dispatch:
env:
# auto merge from PomeloWang/genshin-impact-helper, default: false
ALLOW_MERGE: 'false'
RUN_ENV: 'prod'
jobs:
build:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
steps:
- name: Set Timezone
uses: actions/set-timezone-action@v1.1
with:
timezoneLinux: "Asia/Shanghai"
- name: Checkout master
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Auto merge
if: ${{ env.ALLOW_MERGE != 'false' }}
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git remote add upstream https://github.com/PomeloWang/genshin-impact-helper
git pull upstream master --allow-unrelated-histories
git push origin master
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Run sign
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
echo "${{ secrets.COOKIE }}" | tr '#' "\n" | sed 's/$/&#${{ secrets.SCKEY }}/g' | xargs -I {} sh -c 'echo "{}" | python3 ./genshin.py'