OP_Build #40
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: OP_Build | |
on: | |
workflow_dispatch: | |
inputs: | |
ROM_URL: | |
description: 'ROM_URL' | |
required: true | |
default: '在这写直链哦亲亲' | |
REPACK_NAME: | |
description: 'REPACK_NAME' | |
required: true | |
default: '这里写名字哦.7z' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: 获取此存储库的源代码... | |
uses: actions/checkout@main | |
with: | |
path: Action_OPT | |
- name: 获取变量配置... | |
run: | | |
echo "BUILD_TIME=$(date +%s | md5sum | awk '{print substr($1,1,10)}')" >> $GITHUB_ENV | |
- name: 配置环境... | |
run: | | |
sudo apt install -y git wget git zip unzip curl axel aria2 zstd rename | |
- name: 获取本仓库原包工具... | |
uses: actions/checkout@main | |
with: | |
repository: tosasitill/xiaoxinSGSI | |
path: Original_package_tool | |
- name: Replace custom condensed content... | |
run: | | |
sudo chmod 777 -R $GITHUB_WORKSPACE/Original_package_tool | |
- name: 下载ROM... | |
run: | | |
cd $GITHUB_WORKSPACE/Original_package_tool | |
mkdir tmp | |
cd tmp | |
aria2c -x 16 --check-certificate=false ${{ github.event.inputs.ROM_URL }} | |
echo "zip_file: $(ls "$GITHUB_WORKSPACE/Original_package_tool/tmp/")" | |
- name: 配置工具环境... | |
run: | | |
sudo sed -i 's/USE_MIRROR_FOR_PIP\=true/USE_MIRROR_FOR_PIP\=false/' $GITHUB_WORKSPACE/Original_package_tool/setup.sh | |
sudo bash $GITHUB_WORKSPACE/Original_package_tool/setup.sh | |
sudo apt-get -y --purge remove "adoptopenjdk-11-hotspot" | |
java -version | |
cp $GITHUB_WORKSPACE/Action_OPT/Config.sh $GITHUB_WORKSPACE/Original_package_tool/ -r | |
pip3 install aligo | |
- name: 开始处理原包... | |
run: | | |
cd ${{ github.workspace }}/Original_package_tool/ | |
sudo bash ./make.sh AB << EOF | |
- name: 压缩中... | |
if: ${{ github.event.inputs.ALI }} != '1' | |
run: | | |
cd $GITHUB_WORKSPACE/Original_package_tool | |
pwd | |
7za a -t7z -r AB_${{ github.event.inputs.REPACK_NAME }} X/* | |
ls "AB_${{ github.event.inputs.REPACK_NAME }}" | |
echo "--------------------------------------" | |
ls | |
echo "--------------------------------------" | |
mkdir upload_ab | |
echo "--------------------------------------" | |
ls upload_ab | |
echo "--------------------------------------" | |
if [ $(ls -l AB_${{ github.event.inputs.REPACK_NAME }} | awk '{print $5}') -gt 2147483647 ]; then tar cvzpf - AB_${{ github.event.inputs.REPACK_NAME }} | split -d -b 1024m - upload_ab/AB_${{ github.event.inputs.REPACK_NAME }}; else mv AB_${{ github.event.inputs.REPACK_NAME }} upload_ab/AB_${{ github.event.inputs.REPACK_NAME }}; fi | |
echo "--------------------------------------" | |
ls upload_ab | |
echo "--------------------------------------" | |
- name: 开始上传至Releases | |
if: ${{ github.event.inputs.ALI }} != '1' | |
uses: ncipollo/release-action@v1.8.0 | |
with: | |
artifacts: "${{ github.workspace }}/Original_package_tool/upload_ab/*" | |
tag: "${{ github.event.inputs.REPACK_NAME }}_${{ env.BUILD_TIME }}" | |
bodyFile: "${{ github.workspace }}/Original_package_tool/X/build_info.txt" | |
token: ${{ secrets.GITHUB_TOKEN }} |