diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 5b20cf2a4..301a4d510 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -93,18 +93,24 @@ jobs: - name: Build Android run: | cd IsraelHiking.Web/android - ./gradlew :app:bundleRelease "-Pandroid.injected.signing.store.file=$WORKSPACE/IsraelHiking.Web/signing/IHM.jks" "-Pandroid.injected.signing.store.password=$STORE_PASSWORD" "-Pandroid.injected.signing.key.alias=ihmkey" "-Pandroid.injected.signing.key.password=$PASSWORD" - #./gradlew --no-daemon bundleRelease + ./gradlew :app:assembleRelease --no-daemon "-Pandroid.injected.signing.store.file=$WORKSPACE/IsraelHiking.Web/signing/IHM.jks" "-Pandroid.injected.signing.store.password=$STORE_PASSWORD" "-Pandroid.injected.signing.key.alias=ihmkey" "-Pandroid.injected.signing.key.password=$PASSWORD" + ./gradlew :app:bundleRelease --no-daemon "-Pandroid.injected.signing.store.file=$WORKSPACE/IsraelHiking.Web/signing/IHM.jks" "-Pandroid.injected.signing.store.password=$STORE_PASSWORD" "-Pandroid.injected.signing.key.alias=ihmkey" "-Pandroid.injected.signing.key.password=$PASSWORD" env: STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} PASSWORD: ${{ secrets.PASSWORD }} WORKSPACE: ${{ github.workspace }} - - name: Upload artifacts + - name: Upload aab artifacts uses: actions/upload-artifact@v4 with: name: IHM_signed_${{ needs.version.outputs.version_string }}.aab path: IsraelHiking.Web/android/app/build/outputs/bundle/release/app-release.aab + + - name: Upload apk artifacts + uses: actions/upload-artifact@v4 + with: + name: IHM_signed_${{ needs.version.outputs.version_string }}.apk + path: IsraelHiking.Web/android/app/build/outputs/apk/release/app-release.apk - name: Publish to Google Play if: ${{ github.event.inputs.publishandroid == 'true' }} diff --git a/IsraelHiking.Web/src/application/services/offline-files-download.service.ts b/IsraelHiking.Web/src/application/services/offline-files-download.service.ts index 42afe16be..9897d9f6f 100644 --- a/IsraelHiking.Web/src/application/services/offline-files-download.service.ts +++ b/IsraelHiking.Web/src/application/services/offline-files-download.service.ts @@ -133,7 +133,7 @@ export class OfflineFilesDownloadService { return fileNames as Record; } - public async isExpired(): Promise { + public async isExpired(): Promise { try { await firstValueFrom(this.httpClient.get(Urls.offlineFiles, { params: { lastModified: null } @@ -141,8 +141,10 @@ export class OfflineFilesDownloadService { return false; } catch (ex) { const typeAndMessage = this.loggingService.getErrorTypeAndMessage(ex); - return typeAndMessage.type === "server" && typeAndMessage.statusCode === 403; + if (typeAndMessage.type === "server" && typeAndMessage.statusCode === 403) { + return true; + } + return undefined; } - } } diff --git a/IsraelHiking.Web/src/application/services/purchase.service.ts b/IsraelHiking.Web/src/application/services/purchase.service.ts index 57c14bd5a..7b1fa3d34 100644 --- a/IsraelHiking.Web/src/application/services/purchase.service.ts +++ b/IsraelHiking.Web/src/application/services/purchase.service.ts @@ -30,9 +30,12 @@ export class PurchaseService { this.loggingService.info("[Store] Logged in: " + userInfo.id); this.initializeCdvStore(userInfo.id); this.offlineFilesDownloadService.isExpired().then((isExpired) => { - if (isExpired) { + if (isExpired === true) { this.loggingService.debug("[Store] Product is expired from server"); this.store.dispatch(new SetOfflineAvailableAction(false)); + } else if (isExpired === false) { + this.loggingService.debug("[Store] Product is valid from server"); + this.store.dispatch(new SetOfflineAvailableAction(true)); } }); });