-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.55 KB
/
task.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Check Update and Upload Releases
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Check Update
run: python fetch.py
- name: Download Latest Stable Release
run: python download.py
- name: Get Tag
id: get_tag
run: echo "tag=$(cat last_download.txt)" >> $GITHUB_ENV
- name: Check for EXE Files
id: check_files
run: |
if find . -name "*.exe" -print -quit | grep -q .; then
echo "exe_exists=true" >> $GITHUB_ENV
else
echo "exe_exists=false" >> $GITHUB_ENV
fi
- name: Commit Files
env:
TZ: America/New_York
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m ":pencil: Auto update Chrome at $(date +"%Y-%m-%d %H:%M")" -a
- name: Push Changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Upload Release
if: env.exe_exists == 'true'
uses: softprops/[email protected]
with:
tag_name: ${{ env.tag }}
files: '*.exe'