Skip to content

Commit

Permalink
ci: move build.sh into the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
esauvisky authored Nov 13, 2023
1 parent 17aae92 commit 2846500
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2846500

Please sign in to comment.