Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新ReduceMIUI 3.0 #33

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Auto detect text files and perform LF normalization
* text=auto
*.txt text eol=lf
*.sh text eol=lf
*.prop text eol=lf
ReduceMIUI/META-INF/com/google/android/update-binary text eol=lf
ReduceMIUI/META-INF/com/google/android/update-script text eol=lf
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: release
on:
push:
paths:
- "ReduceMIUI.json"
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 1. 准备文件
run: |
echo "version=$(jq .version $GITHUB_WORKSPACE/ReduceMIUI.json)" >> $GITHUB_ENV
echo "versionCode=$(jq .versionCode $GITHUB_WORKSPACE/ReduceMIUI.json)" >> $GITHUB_ENV
echo "ModuleFolderName=ReduceMIUI" >> $GITHUB_ENV
- name: 2. 制作模块
run: |
mkdir -p "$GITHUB_WORKSPACE"/GithubRelease
echo "version=${{ env.version }}" >>$GITHUB_WORKSPACE/${{ env.ModuleFolderName }}/module.prop
echo "versionCode=${{ env.versionCode }}" >>$GITHUB_WORKSPACE/${{ env.ModuleFolderName }}/module.prop
cd $GITHUB_WORKSPACE/${{ env.ModuleFolderName }}
zip -q -r ${{ env.ModuleFolderName }}.zip *
mv $GITHUB_WORKSPACE/${{ env.ModuleFolderName }}/${{ env.ModuleFolderName }}.zip "$GITHUB_WORKSPACE"/GithubRelease/${{ env.ModuleFolderName }}.zip
cd "$GITHUB_WORKSPACE"
touch file.log
echo "${{ env.ModuleFolderName }}.zip" > file.log
- name: 3.上传到Github Release
uses: ncipollo/release-action@main
with:
artifacts: ${{ github.workspace }}/GithubRelease/*
name: "${{ env.ModuleFolderName }} ${{ env.version }}"
tag: "${{ env.version }}"
bodyFile: "${{ github.workspace }}/file.log"
allowUpdates: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: 4. 再次初始化仓库
run: |
rm -rf $GITHUB_WORKSPACE/*
- uses: actions/checkout@v2
- name: 5. 更新下载链接
run: |
git config --global user.email "42595464+DavidPisces@users.noreply.github.com "
git config --global user.name "泠洛"
sed -i '4d' $GITHUB_WORKSPACE/ReduceMIUI.json
browser_download_url=$(curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/DavidPisces/${{ env.ModuleFolderName }}/releases/tags/'${{ env.version }}' | jq .assets[].browser_download_url | cut -d'"' -f2)
sed -i '3a "zipUrl": "https://ghproxy.com/'"$browser_download_url"'",' $GITHUB_WORKSPACE/ReduceMIUI.json
jq . $GITHUB_WORKSPACE/ReduceMIUI.json > $GITHUB_WORKSPACE/new.json
rm -rf $GITHUB_WORKSPACE/ReduceMIUI.json && mv $GITHUB_WORKSPACE/new.json $GITHUB_WORKSPACE/ReduceMIUI.json
git add ./ReduceMIUI.json
if git commit -m "v${{ env.version }}"; then
echo "push=true" >> $GITHUB_ENV
else
echo "push=false" >> $GITHUB_ENV
fi
- if: ${{ env.push == 'true' }}
name: 6. 推送到Magisk Module仓库
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
65 changes: 0 additions & 65 deletions .gitignore

This file was deleted.

176 changes: 0 additions & 176 deletions META-INF/com/google/android/update-binary

This file was deleted.

Loading