git: add workflow for auto mirroring git.yzbruh.space/YZBruh/pmt-renovated.
This commit is contained in:
25
.github/workflows/fetch-changes.yml
vendored
Normal file
25
.github/workflows/fetch-changes.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Mirror External Repo to GitHub
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Mirror external repo
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "actions@github.com"
|
||||
git clone --mirror https://git.yzbruh.space/YZBruh/pmt-renovated.git temp-mirror
|
||||
cd temp-mirror
|
||||
git remote add github https://github.com/ShawkTeam/pmt-renovated.git
|
||||
git push --mirror github
|
||||
21
manager.sh
21
manager.sh
@@ -19,8 +19,7 @@ RELEASE="20250821"
|
||||
|
||||
echo() { command echo "[$THIS]: $@"; }
|
||||
|
||||
checks()
|
||||
{
|
||||
checks() {
|
||||
if ! curl "https://github.com" &>/dev/null; then
|
||||
echo "No internet connection!"
|
||||
exit 1
|
||||
@@ -32,8 +31,7 @@ checks()
|
||||
[ ! -f $PREFIX/bin/wget ] && pkg install -y wget
|
||||
}
|
||||
|
||||
select_variant()
|
||||
{
|
||||
select_variant() {
|
||||
LINK=""; ARCH=""; VARIANT=""
|
||||
|
||||
if getprop ro.product.cpu.abi | grep "arm64-v8a" &>/dev/null; then ARCH="arm64-v8a"
|
||||
@@ -44,8 +42,7 @@ select_variant()
|
||||
LINK="https://github.com/ShawkTeam/pmt-renovated/releases/download/${RELEASE}/pmt-${VARIANT}${ARCH}.zip"
|
||||
}
|
||||
|
||||
download()
|
||||
{
|
||||
download() {
|
||||
echo "Downloading pmt-${VARIANT}${ARCH}.zip (${RELEASE})"
|
||||
if ! wget -O $PREFIX/tmp/pmt.zip "${LINK}" &>/dev/null; then
|
||||
echo "Download failed! LINK=${LINK}"
|
||||
@@ -60,8 +57,7 @@ download()
|
||||
fi
|
||||
}
|
||||
|
||||
setup()
|
||||
{
|
||||
setup() {
|
||||
[ -f $PREFIX/tmp/pmt_static ] && mv $PREFIX/tmp/pmt_static $PREFIX/tmp/pmt
|
||||
set -e
|
||||
install -t $PREFIX/bin $PREFIX/tmp/pmt
|
||||
@@ -72,21 +68,18 @@ setup()
|
||||
echo "Installed successfully. Try running 'pmt' command."
|
||||
}
|
||||
|
||||
uninstall()
|
||||
{
|
||||
uninstall() {
|
||||
rm -f $PREFIX/bin/pmt $PREFIX/lib/libhelper* $PREFIX/lib/libpartition_map* &>/dev/null
|
||||
}
|
||||
|
||||
is_installed()
|
||||
{
|
||||
is_installed() {
|
||||
if /system/bin/which pmt &>/dev/null; then
|
||||
echo "PMT is already installed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup()
|
||||
{
|
||||
cleanup() {
|
||||
rm -f $PREFIX/tmp/pmt* $PREFIX/tmp/lib* $PREFIX/tmp/*.zip &>/dev/null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user