优化com.b**及其之前的图标 #232
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update MIUI Res | |
on: | |
push: | |
paths: | |
- 'icons/**' | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update Icons | |
run: | | |
git config --global user.email sdustpedro@gmail.com | |
git config --global user.name pedroz | |
sha=$(git rev-parse --short HEAD) | |
commit_msg="Deploy ${sha}" | |
mkdir -p /tmp/git_push | |
cp -a -r icons/* /tmp/git_push | |
cd /tmp/git_push | |
remote_repo="https://${{ secrets.GIT_USERS }}:${{ secrets.GIT_TOKEN }}@e.coding.net/miuiicons/icons/icons2.git" | |
git clone --depth 1 $remote_repo /tmp/dest | |
rm -rf /tmp/git_push/.git | |
cp -r /tmp/dest/.git/ /tmp/git_push/.git/ | |
git add . | |
git commit -m "${commit_msg}" || true | |
git push || true | |
cd ${GITHUB_WORKSPACE} | |
mkdir -p temp/res/ | |
cp -rf /tmp/git_push ./temp/res/drawable-xxhdpi/ | |
cp -rf addition/transform_config.xml ./temp | |
cp -rf addition/transform_config2.xml ./temp | |
cd temp | |
zip -r -9 icons.zip * >/dev/null | |
mv icons.zip icons | |
XZ_OPT=-9 tar cJf iconsrepo2.tar.xz icons | |
cd ${GITHUB_WORKSPACE}/temp/res/drawable-xxhdpi/ | |
echo $(ls -l | grep "^d" | wc -l) > ${GITHUB_WORKSPACE}/temp/iconscount.txt | |
cd ${GITHUB_WORKSPACE}/temp/ | |
:> iconsrepo2.ini | |
echo "file_size=`ls -l ./iconsrepo2.tar.xz | awk '{print $5}'`" >> ./iconsrepo2.ini | |
echo "md5=`md5sum ./iconsrepo2.tar.xz|cut -d ' ' -f1`" >> ./iconsrepo2.ini | |
echo "theme_name=主图标仓库" >> ./iconsrepo.ini | |
echo "theme_version=$(TZ=':Asia/Shanghai' date '+%Y%m%d%H%M')" >> ./iconsrepo2.ini | |
#curl -T iconsrepo2.tar.xz -u ${{secrets.coding_password}} "https://miuiicons-generic.pkg.coding.net/icons/files/iconsrepo.tar.xz?version=latest" | |
curl -T iconsrepo2.ini -u ${{secrets.coding_password}} "https://miuiicons-generic.pkg.coding.net/icons/files/iconsrepo2.ini?version=latest" | |
curl -T iconscount.txt -u ${{secrets.coding_password}} "https://miuiicons-generic.pkg.coding.net/icons/files/iconscount.txt?version=latest" | |
curl https://rclone.org/install.sh | sudo bash | |
mkdir -p ~/.config/rclone/ | |
echo ${{ secrets.DBBASE64 }} > base64.txt | |
base64 --decode base64.txt > ~/.config/rclone/rclone.conf | |
rclone copy -P iconsrepo2.tar.xz onedrive:/icons/miui | |