-
Notifications
You must be signed in to change notification settings - Fork 16
50 lines (42 loc) · 1.46 KB
/
upstream.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
# This is a sync magiskboot lastest source with Actions push
name: update_upstream
on:
push:
paths:
- ".github/workflows/upstream.yml"
pull_request:
paths:
- ".github/workflows/upstream.yml"
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
update_upstream:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone repo
run: |
git clone --recurse-submodules https://github.com/xiaoxindada/magiskboot_ndk_on_linux.git magiskboot
- name: Setup environment
run: |
sudo apt-get install -y git
- name: Update source
run: |
cd $GITHUB_WORKSPACE/magiskboot
pip3 install wget
python3 ./build.py --update_code
- name: Create commit and push
run: |
cd $GITHUB_WORKSPACE/magiskboot
UPDATE_ETC_UTC_TIME=$(date +%Y-%m-%d-%H:%M) # Etc/UTC timezone
sudo timedatectl set-timezone 'Asia/Shanghai'
UPDATE_SHANGHAI_TIME=$(date +%Y-%m-%d-%H:%M)
git config --global user.email "2245062854@qq.com"
git config --global user.name "xiaoxindada"
git add .
git commit -sm "Update code date: Asia/Shanghai: $UPDATE_SHANGHAI_TIME
> Etc/UTC: $UPDATE_ETC_UTC_TIME"
git remote rm origin
git remote add origin https://xiaoxindada:${{ secrets.GITHUB_TOKEN }}@github.com/xiaoxindada/magiskboot_ndk_on_linux.git
git push origin main