Skip to content

SGSI_Build

SGSI_Build #1

Workflow file for this run

name: SGSI_Build
on:
workflow_dispatch:
inputs:
ROM_URL:
description: 'ROM_URL'
required: true
default: 'https://bkt-sgp-miui-ota-update-alisgp.oss-ap-southeast-1.aliyuncs.com/V13.0.1.0.RFDCNXM/miui_TUCANA_V13.0.1.0.RFDCNXM_572656a73d_11.0.zip'
ZIP_NAME:
description: 'ZIP_NAME'
required: true
default: 'miui_TUCANA_V13.0.1.0.RFDCNXM_572656a73d_11.0.zip'
OS_TYPE:
description: 'OS_TYPE'
required: true
default: 'miui'
SGSI_TYPE:
description: 'SGSI_TYPE(AB, A, or BOTH)'
required: true
default: 'AB'
REPACK_NAME:
description: 'REPACK_NAME'
required: true
default: 'SGSI.zip'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Get the source code of this repositorie...
uses: actions/checkout@main
- name: Get variable configuration...
run: |
echo "BUILD_TIME=$(date +%s | md5sum | awk '{print substr($1,1,10)}')" >> $GITHUB_ENV
- name: Clean up the environment‌‌...
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo -E apt-get update
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
df -h
- name: Configuration Environment‌‌...
run: |
sudo apt-get install -y git wget git zip unzip curl axel
- name: Get the SGSI tool‌‌...
run: |
git clone --recurse-submodules https://github.com/xiaoxindada/SGSI-build-tool.git -b 11 $GITHUB_WORKSPACE/Tool-SGSI-build
- name: Replace custom condensed content...
run: |
sudo rm -rf $GITHUB_WORKSPACE/Tool-SGSI-build/apps_clean
sudo cp -r apps_clean $GITHUB_WORKSPACE/Tool-SGSI-build/apps_clean
sudo chmod 777 -R $GITHUB_WORKSPACE/Tool-SGSI-build
- name: Download ROM‌‌...
run: |
cd $GITHUB_WORKSPACE/Tool-SGSI-build
mkdir ./tmp
wget -U "Mozilla/5.0" ${{ github.event.inputs.ROM_URL }} -O "$GITHUB_WORKSPACE/Tool-SGSI-build/tmp/${{ github.event.inputs.ZIP_NAME }}"
echo "zip_file: $(ls "$GITHUB_WORKSPACE/Tool-SGSI-build/tmp/")"
- name: Configuration tool environment...
run: |
sudo sed -i 's/USE_MIRROR_FOR_PIP\=true/USE_MIRROR_FOR_PIP\=false/' $GITHUB_WORKSPACE/Tool-SGSI-build/setup.sh
sudo bash $GITHUB_WORKSPACE/Tool-SGSI-build/setup.sh
java -version
- name: Make AB type GSI‌‌...
if: ${{ github.event.inputs.SGSI_TYPE }} == 'AB' || ${{ github.event.inputs.SGSI_TYPE }} == 'BOTH'
run: |
sudo bash $GITHUB_WORKSPACE/Tool-SGSI-build/make.sh AB << EOF
${{ github.event.inputs.ZIP_NAME }}
y
y
${{ github.event.inputs.OS_TYPE }}
y
- name: Packing(AB)...
if: ${{ github.event.inputs.SGSI_TYPE }} == 'AB' || ${{ github.event.inputs.SGSI_TYPE }} == 'BOTH'
run: |
cd $GITHUB_WORKSPACE/Tool-SGSI-build
pwd
zip -r AB_${{ github.event.inputs.REPACK_NAME }} SGSI/*
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: Make A-only type GSI‌‌...
if: ${{ github.event.inputs.SGSI_TYPE }} == 'A' || ${{ github.event.inputs.SGSI_TYPE }} == 'BOTH'
run: |
sudo bash $GITHUB_WORKSPACE/Tool-SGSI-build/make.sh A << EOF
${{ github.event.inputs.ZIP_NAME }}
y
y
${{ github.event.inputs.OS_TYPE }}
y
- name: Packing(A-only)...
if: ${{ github.event.inputs.SGSI_TYPE }} == 'A' || ${{ github.event.inputs.SGSI_TYPE }} == 'BOTH'
run: |
cd $GITHUB_WORKSPACE/Tool-SGSI-build
pwd
zip -r AONLY_${{ github.event.inputs.REPACK_NAME }} SGSI/*
ls "AONLY_${{ github.event.inputs.REPACK_NAME }}"
echo "--------------------------------------"
ls
echo "--------------------------------------"
mkdir upload_aonly
echo "--------------------------------------"
ls upload_aonly
echo "--------------------------------------"
if [ $(ls -l AONLY_${{ github.event.inputs.REPACK_NAME }} | awk '{print $5}') -gt 2147483647 ]; then tar cvzpf - AONLY_${{ github.event.inputs.REPACK_NAME }} | split -d -b 1024m - upload_aonly/AONLY_${{ github.event.inputs.REPACK_NAME }}; else mv AONLY_${{ github.event.inputs.REPACK_NAME }} upload_aonly/AONLY_${{ github.event.inputs.REPACK_NAME }}; fi
echo "--------------------------------------"
ls upload_aonly
echo "--------------------------------------"
- name: Upload to Release‌‌...
uses: ncipollo/[email protected]
with:
artifacts: "${{ github.workspace }}/Tool-SGSI-build/upload_ab/*,${{ github.workspace }}/Tool-SGSI-build/upload_aonly/*"
tag: "${{ github.event.inputs.REPACK_NAME }}_${{ env.BUILD_TIME }}"
bodyFile: "${{ github.workspace }}/Tool-SGSI-build/SGSI/build_info.txt"
token: ${{ secrets.GITHUB_TOKEN }}