Extracting VerCode - Next #817
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Extracting VerCode - Next | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| - cron: '19 15 * * *' | |
| push: | |
| branches: [next] | |
| jobs: | |
| jp: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Install Dependencies | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Set Game Version | |
| run: | | |
| VERSION=$(curl -s "https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder") | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Compare Version with jp.json | |
| run: | | |
| APP_VERSION=$(jq -r '.appVer' "jp.json") | |
| if [ "$APP_VERSION" == "$VERSION" ]; then | |
| echo "UPDATE=false" >> $GITHUB_ENV | |
| else | |
| echo "UPDATE=true" >> $GITHUB_ENV | |
| fi | |
| - name: Set up JDK | |
| if: env.UPDATE == 'true' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Download Edit Tools | |
| if: env.UPDATE == 'true' | |
| run: wget -O fgo-vce.jar "https://github.com/O-Isaac/FGO-VCE/releases/download/v1.0.51-beta/FGO-VCE-1.0-SNAPSHOT-jar-with-dependencies.jar" | |
| - name: Download Game APK | |
| if: env.UPDATE == 'true' | |
| run: wget -O fate.xapk "https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.v${{ env.VERSION }}.xapk" | |
| - name: Extract verCode from APK | |
| if: env.UPDATE == 'true' | |
| run: java -jar fgo-vce.jar -av ${{ env.VERSION }} -o jp.json -xa fate.xapk | |
| - name: Set Current Date | |
| if: env.UPDATE == 'true' | |
| run: echo "DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV | |
| - name: Upload verCode | |
| if: env.UPDATE == 'true' | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| pull: '--rebase --autostash' | |
| add: 'jp.json' | |
| default_author: github_actions | |
| message: 'β¨ Update for JP - Commit on ${{ env.DATE }} π' | |
| na: | |
| needs: jp | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Install Dependencies | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Set Game Version | |
| run: | | |
| VERSION=$(curl -s "https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder.en") | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Compare Version with na.json | |
| run: | | |
| APP_VERSION=$(jq -r '.appVer' "na.json") | |
| if [ "$APP_VERSION" == "$VERSION" ]; then | |
| echo "UPDATE=false" >> $GITHUB_ENV | |
| else | |
| echo "UPDATE=true" >> $GITHUB_ENV | |
| fi | |
| - name: Set up JDK | |
| if: env.UPDATE == 'true' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Download Edit Tools | |
| if: env.UPDATE == 'true' | |
| run: wget -O fgo-vce.jar "https://github.com/O-Isaac/FGO-VCE/releases/download/v1.0.51-beta/FGO-VCE-1.0-SNAPSHOT-jar-with-dependencies.jar" | |
| - name: Download Game APK | |
| if: env.UPDATE == 'true' | |
| run: wget -O fate.xapk "https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.en.v${{ env.VERSION }}.xapk" | |
| - name: Extract verCode from APK | |
| if: env.UPDATE == 'true' | |
| run: java -jar fgo-vce.jar -av ${{ env.VERSION }} -o na.json -xa fate.xapk | |
| - name: Set Current Date | |
| if: env.UPDATE == 'true' | |
| run: echo "DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV | |
| - name: Upload verCode | |
| if: env.UPDATE == 'true' | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| pull: '--rebase --autostash' | |
| add: 'na.json' | |
| default_author: github_actions | |
| message: 'β¨ Update for NA - Commit on ${{ env.DATE }} π' |