-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: SGSI_Build_rar | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ROM_URL: | ||
description: 'ROM_URL' | ||
required: true | ||
default: 'http://down.eebbk.net/xzzc/s6/%E5%AE%B6%E6%95%99%E6%9C%BA_S6_V2.1.0_Recovery%E6%81%A2%E5%A4%8D%E5%B7%A5%E5%85%B7.rar' | ||
ZIP_NAME: | ||
description: 'ZIP_NAME' | ||
required: true | ||
default: 'update.zip' | ||
OS_TYPE: | ||
description: 'OS_TYPE' | ||
required: true | ||
default: 'Generic' | ||
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 unrar | ||
- 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/1.rar" | ||
unrar e ./tmp/1.rar ./tmp | ||
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 | ||
sudo apt-get -y --purge remove "adoptopenjdk-11-hotspot" | ||
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: Upload to Release... | ||
uses: ncipollo/release-action@v1.8.6 | ||
with: | ||
artifacts: "${{ github.workspace }}/Tool-SGSI-build/upload_ab/*" | ||
tag: "${{ github.event.inputs.REPACK_NAME }}_${{ env.BUILD_TIME }}" | ||
bodyFile: "${{ github.workspace }}/Tool-SGSI-build/SGSI/build_info.txt" | ||
token: ${{ secrets.GITHUB_TOKEN }} |