Skip to content

update_upstream

update_upstream #974

Workflow file for this run

# 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