Skip to content

Commit 214808a

Browse files
Merge branch 'release/5.220.0'
2 parents 998afc9 + b27bcbb commit 214808a

File tree

237 files changed

+11506
-6501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+11506
-6501
lines changed

.github/workflows/release_create_tag.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,23 @@ jobs:
2727
with:
2828
submodules: recursive
2929
token: ${{ secrets.GT_DAXMOBILE }}
30+
fetch-depth: 0
3031

3132
- name: Set up ruby env
3233
uses: ruby/setup-ruby@v1
3334
with:
3435
ruby-version: 2.7.2
3536
bundler-cache: true
3637

38+
- name: Set up git config
39+
run: |
40+
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
41+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
42+
git config --local user.name "github-actions[bot]"
43+
3744
- name: Use fastlane lane to create and push tagged release
3845
id: create_git_tag
39-
run: |
46+
run: |
4047
bundle exec fastlane android tag_and_push_release_version app_version:${{ github.event.inputs.app-version }}
4148
4249
- name: Create Asana task when workflow failed

.github/workflows/release_nightly.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
env:
99
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
1010
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'
11+
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}
1112

1213
jobs:
1314
create-tag:
@@ -20,11 +21,7 @@ jobs:
2021
with:
2122
submodules: recursive
2223
token: ${{ secrets.GT_DAXMOBILE }}
23-
24-
- name: Set Git permissions
25-
uses: oleksiyrudenko/gha-git-credentials@v2-latest
26-
with:
27-
token: '${{ secrets.GT_DAXMOBILE }}'
24+
fetch-depth: 0
2825

2926
- name: Set up JDK 17
3027
uses: actions/setup-java@v4
@@ -38,11 +35,16 @@ jobs:
3835
ruby-version: 2.7.2
3936
bundler-cache: true
4037

38+
- name: Set up git config
39+
run: |
40+
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
41+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
42+
git config --local user.name "github-actions[bot]"
43+
4144
- name: Get latest tag
4245
id: get_latest_tag
4346
run: |
44-
git fetch --tags
45-
output=$(git describe --tags `git rev-list --tags --max-count=1`)
47+
output=$(git for-each-ref --sort=taggerdate --format='%(refname:short)' refs/tags | tail -n 1)
4648
echo "Latest tag: $output"
4749
echo "latest_tag=$output" >> $GITHUB_OUTPUT
4850
@@ -101,6 +103,7 @@ jobs:
101103
- name: Tag Nightly release
102104
id: tag_nightly_release
103105
run: |
106+
git checkout develop
104107
git tag -a ${{ steps.generate_version_name.outputs.version }} -m "Create tag ${{ steps.generate_version_name.outputs.version }} for nightly release."
105108
git push origin ${{ steps.generate_version_name.outputs.version }}
106109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Release - Production Release to Play Store and Github
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
8+
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}
9+
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'
10+
11+
jobs:
12+
release-production:
13+
runs-on: ubuntu-latest
14+
name: Publish Bundle to Play Store Internal track
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
token: ${{ secrets.GT_DAXMOBILE }}
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v3
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '17'
30+
distribution: 'adopt'
31+
32+
- name: Set up ruby env
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: 2.7.2
36+
bundler-cache: true
37+
38+
- name: Set up git config
39+
run: |
40+
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
41+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
42+
git config --local user.name "github-actions[bot]"
43+
44+
- name: Decode upload keys
45+
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
46+
with:
47+
secret: ${{ secrets.UPLOAD_RELEASE_PROPERTIES }}
48+
fileName: ddg_android_build_upload.properties
49+
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/
50+
51+
- name: Decode key file
52+
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
53+
with:
54+
secret: ${{ secrets.UPLOAD_RELEASE_KEY }}
55+
fileName: ddg-upload-keystore.jks
56+
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/
57+
58+
- name: Decode Play Store credentials file
59+
uses: davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
60+
with:
61+
secret: ${{ secrets.UPLOAD_PLAY_CREDENTIALS }}
62+
fileName: api.json
63+
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/
64+
65+
- name: Assemble the bundle
66+
run: ./gradleW bundleRelease -PuseUploadSigning
67+
68+
- name: Capture App Bundle Path
69+
id: capture_output
70+
run: |
71+
output=$(find app/build/outputs/bundle/playRelease -name "*.aab")
72+
echo "bundle_path=$output" >> $GITHUB_OUTPUT
73+
74+
- name: Upload bundle to Play Store
75+
id: create_app_bundle
76+
run: |
77+
bundle exec fastlane deploy_playstore
78+
79+
- name: Upload Universal APK to Github
80+
id: create_app_bundle
81+
run: |
82+
bundle exec fastlane deploy_github
83+
84+
- name: Upload APK as artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: duckduckgo-${{ steps.generate_version_name.outputs.version }}.apk
88+
path: duckduckgo.apk
89+
90+
- name: Create Asana task when workflow failed
91+
if: ${{ failure() }}
92+
uses: duckduckgo/[email protected]
93+
with:
94+
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
95+
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
96+
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
97+
asana-task-name: GH Workflow Failure - Production Release
98+
asana-task-description: The Production Release to Play Store and Github workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
99+
action: 'create-asana-task'

anvil/anvil-annotations/src/main/java/com/duckduckgo/anvil/annotations/ContributesRemoteFeature.kt

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ annotation class ContributesRemoteFeature(
5555
val featureName: String,
5656

5757
/** The class that implements the [FeatureSettings.Store] interface */
58+
@Deprecated("Not needed anymore. Settings is now supported in top-level and sub-features and Toggle#getSettings returns it")
5859
val settingsStore: KClass<*> = Unit::class,
5960

6061
/** The class that implements the [FeatureExceptions.Store] interface */

anvil/anvil-compiler/src/main/java/com/duckduckgo/anvil/compiler/ContributesRemoteFeatureCodeGenerator.kt

+6-8
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
498498
minSupportedVersion = feature.minSupportedVersion,
499499
targets = emptyList(),
500500
cohorts = emptyList(),
501+
settings = feature.settings?.toString(),
501502
)
502503
)
503504
@@ -528,7 +529,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
528529
weight = cohort.weight,
529530
)
530531
} ?: emptyList()
531-
val config = jsonToggle?.config ?: emptyMap()
532+
val settings = jsonToggle?.settings?.toString()
532533
this.feature.get().invokeMethod(subfeature.key).setRawStoredState(
533534
Toggle.State(
534535
remoteEnableState = newStateValue,
@@ -539,7 +540,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
539540
assignedCohort = previousAssignedCohort,
540541
targets = targets,
541542
cohorts = cohorts,
542-
config = config,
543+
settings = settings,
543544
),
544545
)
545546
} catch(e: Throwable) {
@@ -781,10 +782,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
781782
"cohorts",
782783
List::class.asClassName().parameterizedBy(FqName("JsonToggleCohort").asClassName(module)),
783784
)
784-
.addParameter(
785-
"config",
786-
Map::class.asClassName().parameterizedBy(String::class.asClassName(), String::class.asClassName()),
787-
)
785+
.addParameter("settings", FqName("org.json.JSONObject").asClassName(module).copy(nullable = true))
788786
.build(),
789787
)
790788
.addProperty(
@@ -819,8 +817,8 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
819817
)
820818
.addProperty(
821819
PropertySpec
822-
.builder("config", Map::class.asClassName().parameterizedBy(String::class.asClassName(), String::class.asClassName()))
823-
.initializer("config")
820+
.builder("settings", FqName("org.json.JSONObject").asClassName(module).copy(nullable = true))
821+
.initializer("settings")
824822
.build(),
825823
)
826824
.build()

0 commit comments

Comments
 (0)