-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
406 changed files
with
20,026 additions
and
1,806 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: 'Check for code changes after a specific tag' | ||
description: 'Checks if there are any new commits to the develop branch since the specified tag' | ||
|
||
inputs: | ||
tag: | ||
description: 'Tag to check' | ||
required: true | ||
|
||
outputs: | ||
has_changes: | ||
description: Whether there are new commits since the last tag | ||
value: ${{ steps.check_for_changes.outputs.has_changes }} | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- id: check_for_changes | ||
shell: bash | ||
run: | | ||
# Check if there are any new commits since the tag | ||
new_commits=$(git rev-list ${{ inputs.tag }}..develop --count) | ||
echo "$new_commits commits since ${{ inputs.tag }} tag" | ||
if [ $new_commits -gt 0 ]; then | ||
echo "has_changes=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "has_changes=false" >> $GITHUB_OUTPUT | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,71 +48,101 @@ jobs: | |
echo "Latest tag: $output" | ||
echo "latest_tag=$output" >> $GITHUB_OUTPUT | ||
- name: Check for changes | ||
id: check_for_changes | ||
uses: ./.github/actions/check-for-changes-since-tag | ||
with: | ||
github_token: ${{ secrets.GT_DAXMOBILE }} | ||
tag: ${{ steps.get_latest_tag.outputs.latest_tag }} | ||
|
||
- name: Notify if no changes | ||
if: steps.check_for_changes.outputs.has_changes == 'false' | ||
run: | | ||
echo "No new commits since the last tag. Skipping nightly release." | ||
echo "No new commits since the last tag. Skipping nightly release." >> $GITHUB_STEP_SUMMARY | ||
exit 0 | ||
- name: Decode upload keys | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208 | ||
with: | ||
secret: ${{ secrets.UPLOAD_RELEASE_PROPERTIES }} | ||
fileName: ddg_android_build_upload.properties | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Decode key file | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208 | ||
with: | ||
secret: ${{ secrets.UPLOAD_RELEASE_KEY }} | ||
fileName: ddg-upload-keystore.jks | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Decode Play Store credentials file | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208 | ||
with: | ||
secret: ${{ secrets.UPLOAD_PLAY_CREDENTIALS }} | ||
fileName: api.json | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Decode Firebase credentials file | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208 | ||
with: | ||
secret: ${{ secrets.UPLOAD_FIREBASE_CREDENTIALS }} | ||
fileName: ddg-upload-firebase.json | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Clean project | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
run: | | ||
gradle clean | ||
- name: Assemble the bundle | ||
run: gradle bundleInternalRelease -PversionNameSuffix=-nightly -PuseUploadSigning -PlatestTag=${{ steps.get_latest_tag.outputs.latest_tag }} | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
run: gradle bundleInternalRelease -PversionNameSuffix=-nightly -PuseUploadSigning -PlatestTag=${{ steps.get_latest_tag.outputs.latest_tag }} -Pbuild-date-time | ||
|
||
- name: Generate nightly version name | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
id: generate_version_name | ||
run: | | ||
output=$(gradle getBuildVersionName -PversionNameSuffix=-nightly -PlatestTag=${{ steps.get_latest_tag.outputs.latest_tag }} --quiet | tail -n 1) | ||
echo "version=$output" >> $GITHUB_OUTPUT | ||
- name: Capture App Bundle Path | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
id: capture_output | ||
run: | | ||
output=$(find app/build/outputs/bundle/internalRelease -name "*.aab") | ||
echo "bundle_path=$output" >> $GITHUB_OUTPUT | ||
- name: Upload bundle to Play Store Internal track | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
id: create_app_bundle | ||
run: | | ||
bundle exec fastlane deploy_dogfood aab_path:${{ steps.capture_output.outputs.bundle_path }} | ||
- name: Tag Nightly release | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
id: tag_nightly_release | ||
run: | | ||
git checkout develop | ||
git tag -a ${{ steps.generate_version_name.outputs.version }} -m "Create tag ${{ steps.generate_version_name.outputs.version }} for nightly release." | ||
git push origin ${{ steps.generate_version_name.outputs.version }} | ||
- name: Upload APK as artifact | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: duckduckgo-${{ steps.generate_version_name.outputs.version }}.apk | ||
path: duckduckgo.apk | ||
|
||
- name: Set successful summary | ||
if: steps.check_for_changes.outputs.has_changes == 'true' | ||
run: | | ||
echo "### Nightly release completed! :rocket:" >> $GITHUB_STEP_SUMMARY | ||
- name: Create Asana task when workflow failed | ||
if: ${{ failure() }} | ||
uses: duckduckgo/[email protected] | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ jobs: | |
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Assemble the bundle | ||
run: ./gradleW bundleRelease -PuseUploadSigning | ||
run: ./gradlew bundleRelease -PuseUploadSigning -Pbuild-date-time | ||
|
||
- name: Capture App Bundle Path | ||
id: capture_output | ||
|
@@ -72,21 +72,15 @@ jobs: | |
echo "bundle_path=$output" >> $GITHUB_OUTPUT | ||
- name: Upload bundle to Play Store | ||
id: create_app_bundle | ||
id: upload_bundle_play | ||
run: | | ||
bundle exec fastlane deploy_playstore | ||
- name: Upload Universal APK to Github | ||
id: create_app_bundle | ||
id: upload_bundle_github | ||
run: | | ||
bundle exec fastlane deploy_github | ||
- name: Upload APK as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: duckduckgo-${{ steps.generate_version_name.outputs.version }}.apk | ||
path: duckduckgo.apk | ||
|
||
- name: Create Asana task when workflow failed | ||
if: ${{ failure() }} | ||
uses: duckduckgo/[email protected] | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
...va/com/duckduckgo/mobile/android/vpn/ui/tracker_activity/view/message/SubscriptionsExt.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2024 DuckDuckGo | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.duckduckgo.mobile.android.vpn.ui.tracker_activity.view.message | ||
|
||
import com.duckduckgo.subscriptions.api.Subscriptions | ||
|
||
suspend fun Subscriptions.isUpsellEligible(): Boolean { | ||
return !isSignedIn() && isEligible() | ||
} |
Oops, something went wrong.