diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d514d05..5761f9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,16 +10,51 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setting environment variables for date, ads, unity, and version - run: > - touch local.properties - # echo "DATE_TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - # echo "GIT_TAG=$(grep -E "versionName\s*=?\s*['\"]" "app/build.gradle.kts" | awk -F"['\"]" '{print $2}')" >> $GITHUB_ENV - echo "IAP_NO_ADS=${{ secrets.IAP_NO_ADS }}" > ./local.properties - echo "PLACEMENT_BANNER_1=${{ secrets.PLACEMENT_BANNER_1 }}" > local.properties - echo "PLACEMENT_BANNER_2=${{ secrets.PLACEMENT_BANNER_2 }}" > local.properties - echo "PLACEMENT_INTERSTITIAL=${{ secrets.PLACEMENT_INTERSTITIAL }}" > local.properties - echo "PLAY_CONSOLE_APP_RSA_KEY=${{ secrets.PLAY_CONSOLE_APP_RSA_KEY }}" > local.properties - echo "UNITY_APP_ID=${{ secrets.UNITY_APP_ID }}" > ./local.properties - - name: Set IAP_NO_ADS run: | - echo $(cat local.properties | grep IAP_NO_ADS | cut -d '=' -f 2) + echo "DATE_TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + echo "IAP_NO_ADS=$(echo ${{ secrets.IAP_NO_ADS }})" >> $GITHUB_ENV + echo "PLACEMENT_BANNER_1=$(echo ${{ secrets.PLACEMENT_BANNER_1 }})" >> $GITHUB_ENV + echo "PLACEMENT_BANNER_1=$(echo ${{ secrets.PLACEMENT_BANNER_1 }})" >> $GITHUB_ENV + echo "PLACEMENT_BANNER_2=$(echo ${{ secrets.PLACEMENT_BANNER_2 }})" >> $GITHUB_ENV + echo "PLACEMENT_INTERSTITIAL=$(echo ${{ secrets.PLACEMENT_INTERSTITIAL }})" >> $GITHUB_ENV + echo "PLAY_CONSOLE_APP_RSA_KEY=$(echo ${{ secrets.PLAY_CONSOLE_APP_RSA_KEY }})" >> $GITHUB_ENV + echo "UNITY_APP_ID=$(echo ${{ secrets.UNITY_APP_ID }})" >> $GITHUB_ENV + echo "GIT_TAG=$(grep -E "versionName\s*=?\s*['\"]" "app/build.gradle.kts" | awk -F"['\"]" '{print $2}')" >> $GITHUB_ENV + - name: Configuring Java environment with Zulu JDK 17 and Gradle cache, + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: "17" + cache: gradle + - name: Granting executable permission to gradlewGenerating Unsigned Apk & Bundle + run: | + chmod +x ./gradlew + ./gradlew assembleRelease + ./gradlew bundleRelease + - name: Signing APK + uses: r0adkll/sign-android-release@v1 + id: signed_apk + with: + releaseDirectory: app/build/outputs/apk/release/ + signingKeyBase64: ${{ secrets.SIGNING_KEY_STORE_BASE64 }} + alias: ${{ secrets.SIGNING_KEY_ALIAS }} + keyStorePassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + - name: Sign AAB + uses: r0adkll/sign-android-release@v1 + id: signed_aab + with: + releaseDirectory: app/build/outputs/bundle/release/ + signingKeyBase64: ${{ secrets.SIGNING_KEY_STORE_BASE64 }} + alias: ${{ secrets.SIGNING_KEY_ALIAS }} + keyStorePassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + - name: Create Github Release using tag name v${{ env.GIT_TAG }} and uploading signed APK and AAB files + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ env.GIT_TAG }} + generate_release_notes: true + prerelease: false + files: | + ${{steps.signed_aab.outputs.signedReleaseFile}} + ${{steps.signed_apk.outputs.signedReleaseFile}}