Skip to content

Commit

Permalink
feat: Support build AB and A-only at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
XayahSuSuSu committed Sep 1, 2021
1 parent 923582a commit 223dd07
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions .github/workflows/SGSI_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
required: true
default: 'miui'
SGSI_TYPE:
description: 'SGSI_TYPE(AB or A)'
description: 'SGSI_TYPE(AB, A, or BOTH)'
required: true
default: 'AB'
REPACK_NAME:
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
java -version
- name: Make AB type GSI‌‌...
if: ${{ github.event.inputs.SGSI_TYPE }} == 'AB'
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 }}
Expand All @@ -87,8 +87,27 @@ jobs:
${{ 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'
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 }}
Expand All @@ -97,28 +116,29 @@ jobs:
${{ github.event.inputs.OS_TYPE }}
y
- name: Packing...
- 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 ${{ github.event.inputs.REPACK_NAME }} SGSI/*
ls "${{ github.event.inputs.REPACK_NAME }}"
zip -r AONLY_${{ github.event.inputs.REPACK_NAME }} SGSI/*
ls "AONLY_${{ github.event.inputs.REPACK_NAME }}"
echo "--------------------------------------"
ls
echo "--------------------------------------"
mkdir upload
mkdir upload_aonly
echo "--------------------------------------"
ls upload
ls upload_aonly
echo "--------------------------------------"
if [ $(ls -l ${{ github.event.inputs.REPACK_NAME }} | awk '{print $5}') -gt 2147483647 ]; then tar cvzpf - ${{ github.event.inputs.REPACK_NAME }} | split -d -b 1024m - upload/${{ github.event.inputs.REPACK_NAME }}; else mv ${{ github.event.inputs.REPACK_NAME }} upload/${{ github.event.inputs.REPACK_NAME }}; fi
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
ls upload_aonly
echo "--------------------------------------"
- name: Upload to Release‌‌...
uses: ncipollo/release-action@v1.8.0
with:
artifacts: "${{ github.workspace }}/Tool-SGSI-build/upload/*"
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 }}

0 comments on commit 223dd07

Please sign in to comment.