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: