Skip to content

Commit

Permalink
ci: fix possible update error
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hc authored Aug 23, 2022
1 parent 4d64641 commit 94d8710
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
overwrite: false

- name: Switch to update branch
run: git checkout -f update || git switch --discard-changes --orphan update
run: |
git checkout -f update || { git switch --discard-changes --orphan update; : >dummy.json; }
- name: Update changelog and Magisk update jsons
id: update_config
Expand All @@ -80,34 +81,28 @@ jobs:
\"changelog\": \"$4\"
}"
}
IS_MODULE_UPDATE=0
if [ -n "${{ steps.get_output.outputs.YT_OUTPUT }}" ]; then
IS_MODULE_UPDATE=1
YT_VER=$(echo "${{ steps.get_output.outputs.BUILD_LOG }}" | sed -n 's/.*YouTube version: \(.*\)/\1/p')
YT_DLURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE}}/${{ steps.get_output.outputs.YT_OUTPUT }}"
UPDATE_YT_JSON=$(get_update_json "$YT_VER" "${{ steps.next_ver_code.outputs.NEXT_VER_CODE}}" "$YT_DLURL" "$CHANGELOG_URL")
echo "$UPDATE_YT_JSON" >yt-update.json
fi
if [ -n "${{ steps.get_output.outputs.MUSIC_OUTPUT_ARM64 }}" ]; then
IS_MODULE_UPDATE=1
MUSIC_VER=$(echo "${{ steps.get_output.outputs.BUILD_LOG }}" | sed -n 's/.*Music (arm64-v8a) version: \(.*\)/\1/p')
MUSIC_ARM64_DLURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE}}/${{ steps.get_output.outputs.MUSIC_OUTPUT_ARM64 }}"
UPDATE_MUSIC_ARM64_JSON=$(get_update_json "$MUSIC_VER" "${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}" "$MUSIC_ARM64_DLURL" "$CHANGELOG_URL")
echo "$UPDATE_MUSIC_ARM64_JSON" >music-update-arm64-v8a.json
fi
if [ -n "${{ steps.get_output.outputs.MUSIC_OUTPUT_ARM }}" ]; then
IS_MODULE_UPDATE=1
MUSIC_VER=$(echo "${{ steps.get_output.outputs.BUILD_LOG }}" | sed -n 's/.*Music (arm-v7a) version: \(.*\)/\1/p')
MUSIC_ARM_DLURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE}}/${{ steps.get_output.outputs.MUSIC_OUTPUT_ARM }}"
UPDATE_MUSIC_ARM_JSON=$(get_update_json "$MUSIC_VER" "${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}" "$MUSIC_ARM_DLURL" "$CHANGELOG_URL")
echo "$UPDATE_MUSIC_ARM_JSON" >music-update-arm-v7a.json
fi
echo ::set-output name=IS_MODULE_UPDATE::$IS_MODULE_UPDATE
- uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ steps.update_config.outputs.IS_MODULE_UPDATE == 1 }}
with:
branch: update
skip_checkout: true
Expand Down

0 comments on commit 94d8710

Please sign in to comment.