-
Notifications
You must be signed in to change notification settings - Fork 31
66 lines (57 loc) · 1.73 KB
/
task.yml
File metadata and controls
66 lines (57 loc) · 1.73 KB
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
57
58
59
60
61
62
63
64
65
66
name: Check Update and Upload Releases
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 */1 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check Update
run: python fetch.py
- name: Download Latest Stable Releases
run: python download.py
- 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: Check if Tag Exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ env.latest_version }}" >/dev/null 2>&1; then
echo "tag_exists=true" >> $GITHUB_ENV
else
echo "tag_exists=false" >> $GITHUB_ENV
fi
- name: Commit and Push Changes
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 Edge at $(date +"%Y-%m-%d %H:%M")" -a || echo "No changes to commit"
git push origin main
- name: Upload Release
if: env.exe_exists == 'true' && env.tag_exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.latest_version }}
files: '*.exe'
- name: Reset Main Branch
if: env.exe_exists == 'true' && env.tag_exists == 'false'
run: |
git checkout --orphan temp_branch
git add -A
git commit -m "Init"
git push --force origin temp_branch:main