From 28465002dc25626e1e856cb8a2bd6cae7cd0cce7 Mon Sep 17 00:00:00 2001 From: emi~ Date: Sun, 12 Nov 2023 22:07:16 -0300 Subject: [PATCH] ci: move build.sh into the workflow --- .github/workflows/main.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4364c39..7b124f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,31 +16,30 @@ jobs: uses: actions/checkout@v3 with: ref: 'master' - - - name: "Extract Master Version Code" - run: | - VERSION_CODE=$(grep 'version=' module.prop | cut -d'=' -f2) - echo "MASTER_VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV - name: "Build Master" run: | - sh ./build.sh github - mv *.zip "eMagisk-full-${{ env.MASTER_VERSION_CODE }}.zip" + rm *.zip || true + ver=$(sed -n "s|^versionCode=||p" module.prop) + name=$(sed -n "s|^name=||p" module.prop | sed "s| |-|g") + newVersion=$(echo $ver | sed 's|\(.\)\(.\)\(.\)|\1.\2.\3|') + zip -r "${name}-${newVersion}.zip" . -x ".git/*" "LICENSE" "build.sh" ".gitignore" "*.zip" + echo "Made ${name}-${newVersion} ($ver)" + mv "${name}-${newVersion}.zip" "eMagisk-full-${ver}.zip" - name: "Checkout Standalone Branch" uses: actions/checkout@v3 with: ref: 'standalone' - - name: "Extract Standalone Version Code" - run: | - VERSION_CODE=$(grep 'version=' module.prop | cut -d'=' -f2) - echo "STANDALONE_VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV - - name: "Build Standalone" run: | - sh ./build.sh github - mv *.zip "eMagisk-noatlas-${{ env.STANDALONE_VERSION_CODE }}.zip" + ver=$(sed -n "s|^versionCode=||p" module.prop) + name=$(sed -n "s|^name=||p" module.prop | sed "s| |-|g") + newVersion=$(echo $ver | sed 's|\(.\)\(.\)\(.\)|\1.\2.\3|') + zip -r "${name}-${newVersion}.zip" . -x ".git/*" "LICENSE" "build.sh" ".gitignore" "*.zip" + echo "Made ${name}-${newVersion} ($ver)" + mv "${name}-${newVersion}.zip" "eMagisk-noatlas-${ver}.zip" - uses: "marvinpinto/action-automatic-releases@latest" with: