Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create release APK #2017

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,18 @@ export class OfflineFilesDownloadService {
return fileNames as Record<string, string>;
}

public async isExpired(): Promise<boolean> {
public async isExpired(): Promise<boolean | undefined> {
try {
await firstValueFrom(this.httpClient.get(Urls.offlineFiles, {
params: { lastModified: null }
}).pipe(timeout(5000)));
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;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
});
Expand Down