From 223dd07576285627c1c18c58a136cc024c871c73 Mon Sep 17 00:00:00 2001 From: Xayah <1249475336@qq.com> Date: Wed, 1 Sep 2021 17:54:45 +0800 Subject: [PATCH] feat: Support build AB and A-only at the same time --- .github/workflows/SGSI_Build.yml | 42 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/SGSI_Build.yml b/.github/workflows/SGSI_Build.yml index 76782b7..c55761e 100644 --- a/.github/workflows/SGSI_Build.yml +++ b/.github/workflows/SGSI_Build.yml @@ -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: @@ -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 }} @@ -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 }} @@ -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 }}