Auto Build and Publish #24
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: Auto Build and Publish | |
on: | |
schedule: # run automatically, generally they update on tuesday to thursday, so i think run every friday noon is best | |
# if you want set other time can use this website: http://cron.ciding.cc/ | |
- cron: '0 12 * * 5' # run every week Friday at 12:00 UTC | |
workflow_dispatch: # allow run by manual command | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PUBLISH_TOKEN }} | |
- name: Setup Parameters | |
run: | | |
# setup your parameter here | |
echo "BASE_REPOSITORY=https://github.com/YT-Advanced/MagiskOnWSALocal.git" >> $GITHUB_ENV | |
echo "RELEASE_REPOSITORY=itouakirai/MagiskOnWSAOnlineBuild" >> $GITHUB_ENV | |
echo "PARAMETER="--arch x64 --release-type retail --root-sol magisk --gapps-brand none --remove-amazon --magisk-ver stable --compress-format zip"" >> $GITHUB_ENV | |
- name: Install Git | |
run: sudo apt-get install git | |
- name: Setup GitHub CLI | |
run: | | |
# install last CLI | |
version=$(curl --silent "https://api.github.com/repos/cli/cli/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') | |
version=${version#v} | |
curl -sSL "https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz" -o gh.tar.gz | |
tar xzf gh.tar.gz | |
sudo install gh*/bin/gh /usr/local/bin | |
- name: Authenticate with GitHub CLI | |
run: echo "${{ secrets.PUBLISH_TOKEN }}" | gh auth login --with-token | |
- name: Clone repository | |
run: git clone ${{ env.BASE_REPOSITORY }} MagiskOnWSALocal | |
- name: Install dependencies | |
run: | | |
cd MagiskOnWSALocal | |
# Run install_deps.sh script (depend on they request) | |
chmod +x scripts/install_deps.sh | |
./scripts/install_deps.sh | |
- name: Build | |
run: | | |
cd MagiskOnWSALocal | |
chmod +x ./scripts/build.sh | |
echo "BUILD_TIMESTAMP=$(date -u +"%Y-%m-%d %T")" >> $GITHUB_ENV | |
echo "BUILD_UNIX_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV | |
./scripts/build.sh ${{ env.PARAMETER }} | |
- name: Publish new release | |
run: | | |
cd MagiskOnWSALocal/output | |
FILE=$(ls *.zip) | |
NAME=$(echo $FILE | cut -d '_' -f -2) | |
# Upload limit, '(' ')' will use '.' install | |
CFILE=$(echo $FILE | sed 's/(/./g; s/)/./g') | |
# List all release tags | |
ALL_RELEASES=$(gh release list -R ${{ env.RELEASE_REPOSITORY }} | awk '{print $1}') | |
# Define the release note | |
NOTES=$(cat << EOF | |
**由Github Action构建的最新的**稳定版通道**的带有Magisk并去除Google Play的适用于 Android 的 Windows 子系统** | |
Build: ${{ env.BUILD_TIMESTAMP }} Unix time: ${{ env.BUILD_UNIX_TIMESTAMP }} | |
BASE_REPOSITORY: ${{ env.BASE_REPOSITORY }} | |
PARAMETER: ${{ env.PARAMETER }} | |
- Based on MagiskOnWSA by LSPosed Contributors | |
- Powered by Github Action | |
- Workflow written by me | |
发布附件均由Github Action构建并上传,欢迎审阅[Workflows](https://github.com/$RELEASE_REPOSITORY/tree/main/.github/workflows)源码并提出修改意见。 | |
## **安装快速指南** | |
下载[最新版Magisk_On_$NAME](https://github.com/$RELEASE_REPOSITORY/releases/download/$NAME/${CFILE})的文件即可,国内用户可以使用[Watt Toolkit](https://steampp.net/)的免费代理加速下载(无需注册,加速勾选Github)) | |
### 安装: | |
解压文件夹,拷贝全部文件到任意位置(推荐C盘下创建名为WSA的文件夹并拷贝到其中,请记住你的安装位置;推荐安装在固态硬盘上) | |
运行*run.bat*,等待程序安装 | |
### 更新: | |
解压文件夹,**关闭**安卓子系统,复制文件到你原来安装的文件夹,直接覆盖文件,并运行*run.bat*(如果覆盖不了就是你安卓子系统没关) | |
正常的更新不会丢失任何用户数据,但是请更新过程中不要乱操作,除非你清楚你在干什么。 | |
#### 提示 | |
*不要在安装完成后删除安装目录下的文件。 | |
*最好安装目录中不含有任何复杂符号(中文,各种非英文字符,特殊符号,空格),避免出现奇怪问题。 | |
## 免责声明 | |
本仓库仅以公开的方式自动构建Magisk On 适用于 Android 的 Windows 子系统,不提供对于构建正常、软件能正常运行的保证,不保证您数据的安全性与可靠性。 | |
由于MagiskOnWSA仍然处于更新中,其Build参数可能会变化,本仓库不一定能及时更改,请在安装使用前确保相应参数与你的要求相匹配。 | |
不对错误的Build造成的数据损坏与丢失负任何责任。 | |
我不会收集任何数据,仅以原样提供构建。 | |
*当前仅发布在Github Releases,请勿从其他来源下载,其他来源提供的源文件可能包含恶意程序。 | |
## 发行说明链接 | |
[适用于 Android 的 Windows 子系统发行说明](https://learn.microsoft.com/zh-cn/windows/android/wsa/release-notes) | |
[MagiskOnWSA的详细说明](https://github.com/LSPosed/MagiskOnWSALocal#readme) (出现安装问题与运行问题先阅读本文再提Issue) | |
## 技术支持 | |
本项目不提供关于安卓子系统的任何技术支持,如果自动构建不正常或者有什么建议,请在本仓库提出一个[新的Issue](https://github.com/yige-yigeren/MagiskOnWSAOnlineBuild/issues/new)。 | |
关于Root权限及Google Play运行异常的问题请在MagiskOnWSA提出一个[新的Issue](https://github.com/LSPosed/MagiskOnWSALocal/issues/new/choose)。 | |
关于电脑无法安装安卓子系统和安卓子系统运行问题,请在[微软社区](https://answers.microsoft.com/zh-hans/newthread)提出一个问题(选择Windows-Windows11-应用程序-Amazon Appstore) | |
## 关于版权 | |
MagiskOnWSALocal is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
使用本项目发布的release与代码需遵守[反劳动剥削许可证](https://github.com/yige-yigeren/MagiskOnWSAOnlineBuild/blob/main/Additional_LICENSE_CN) | |
## Star | |
如果这个项目有帮到你,请点个Star,这是对我努力的肯定ヾ(≧▽≦*)o。 | |
If this project has been helpful to you, please give it a Star as a token of appreciation for my effortsヾ(≧▽≦*)o. | |
<p align="center"> | |
<a href="https://star-history.com/#yige-yigeren/MagiskOnWSAOnlineBuild&Date"> | |
<img src="https://api.star-history.com/svg?repos=yige-yigeren/MagiskOnWSAOnlineBuild&type=Date" alt="Star History Chart"> | |
</a> | |
</p> | |
## 适用于 Android 的 Windows 子系统实用工具 | |
**其他开发者创建的工具,仅作建议* | |
[APK安装程序 On Microsoft Store](https://www.microsoft.com/store/productId/9P2JFQ43FPPG) [On Github](https://github.com/Paving-Base/APK-Installer) 提供一键式APK安装,可绑定APK文件 | |
[WSA工具箱 On Microsoft Store](https://www.microsoft.com/store/productId/9PPSP2MKVTGT) [On Github](https://github.com/makazeu/WsaToolbox) APK安装,APP管理,文件传输,扫描二维码 | |
EOF | |
) | |
# if version is exist, it will skip. | |
if [[ -z $(echo "$ALL_RELEASES" | grep "$NAME") ]] | |
then | |
gh release create "$NAME" $FILE -R ${{ env.RELEASE_REPOSITORY }} -t "Magisk_On_$NAME" -n "$NOTES" | |
else | |
echo "The version has not changed, skipping the release." | |
fi | |