diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index fcea9c1..1eebdf6 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -11,20 +11,24 @@ jobs: strategy: matrix: region: - - jp - - na - version: - - https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder - - https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder.en - game: - - https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.xapk - - https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.en.xapk + - jp,https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder,https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.xapk + - na,https://gplay-ver.atlasacademy.workers.dev/?id=com.aniplex.fategrandorder.en,https://fgo.bigcereal.com/apk/com.aniplex.fategrandorder.en.xapk permissions: packages: write contents: write steps: - name: Gettings files from Repo uses: actions/checkout@v2 + - name: Getting enviroment-variable-from-matrix + run: | + $matrix_value = "${{ matrix.region }}" + $parts = $matrix_value -split "," + $region = $parts[0] + $game_url = $parts[1] + $game_ver_url = $parts[2] + echo "REGION=$region" >> $env:GITHUB_ENV + echo "GAME_URL=$game_url" >> $env:GITHUB_ENV + echo "GAME_VER_URL=$game_ver_url" >> $env:GITHUB_ENV - name: Set up JDK uses: actions/setup-java@v4 with: @@ -42,14 +46,14 @@ jobs: - name: Download Game apk run: | mkdir apk - Invoke-WebRequest -Uri "${{ matrix.game }}" -OutFile "apk\fate.xapk" + Invoke-WebRequest -Uri "${{ env.GAME_URL }}" -OutFile "apk\fate.xapk" - name: Merge XAPK into apk run: | java -jar apkeditor.jar m -i apk/fate.xapk -o apk/fate.apk rm apk/fate.xapk - name: Set Game Version run: | - $version = Invoke-RestMethod -Uri "${{ matrix.version }}" + $version = Invoke-RestMethod -Uri "${{ env.GAME_VER_URL }}" echo "VERSION=$version" | Out-File -Append -FilePath $env:GITHUB_ENV - name: Decompiling apk run: java -jar apktool.jar d apk/fate.apk --output files -f @@ -61,8 +65,8 @@ jobs: - name: Get verCode from apk run: | java -jar fgo-vce.jar -s decrypt/stringliteral.json -av ${{ env.VERSION }} - Rename-Item -Path "app.json" -NewName "${{ matrix.region }}json" + Rename-Item -Path "app.json" -NewName "${{ env.REGION }}.json" - name: Upload app.json uses: EndBug/add-and-commit@v9 with: - add: '${{ matrix.region }}.json' + add: '${{ env.REGION }}.json'