Skip to content

Commit

Permalink
Merge branch 'release/5.220.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 14, 2024
2 parents 998afc9 + b27bcbb commit 214808a
Show file tree
Hide file tree
Showing 237 changed files with 11,506 additions and 6,501 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release_create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,23 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.GT_DAXMOBILE }}
fetch-depth: 0

- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true

- name: Set up git config
run: |
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Use fastlane lane to create and push tagged release
id: create_git_tag
run: |
run: |
bundle exec fastlane android tag_and_push_release_version app_version:${{ github.event.inputs.app-version }}
- name: Create Asana task when workflow failed
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}

jobs:
create-tag:
Expand All @@ -20,11 +21,7 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.GT_DAXMOBILE }}

- name: Set Git permissions
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: '${{ secrets.GT_DAXMOBILE }}'
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -38,11 +35,16 @@ jobs:
ruby-version: 2.7.2
bundler-cache: true

- name: Set up git config
run: |
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Get latest tag
id: get_latest_tag
run: |
git fetch --tags
output=$(git describe --tags `git rev-list --tags --max-count=1`)
output=$(git for-each-ref --sort=taggerdate --format='%(refname:short)' refs/tags | tail -n 1)
echo "Latest tag: $output"
echo "latest_tag=$output" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -101,6 +103,7 @@ jobs:
- name: Tag Nightly release
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 }}
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/release_upload_play_store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release - Production Release to Play Store and Github

on:
workflow_dispatch:

env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }}
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'

jobs:
release-production:
runs-on: ubuntu-latest
name: Publish Bundle to Play Store Internal track

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GT_DAXMOBILE }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true

- name: Set up git config
run: |
git remote set-url origin https://${{ secrets.GT_DAXMOBILE }}@github.com/duckduckgo/Android.git/
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Decode upload keys
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
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
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: Assemble the bundle
run: ./gradleW bundleRelease -PuseUploadSigning

- name: Capture App Bundle Path
id: capture_output
run: |
output=$(find app/build/outputs/bundle/playRelease -name "*.aab")
echo "bundle_path=$output" >> $GITHUB_OUTPUT
- name: Upload bundle to Play Store
id: create_app_bundle
run: |
bundle exec fastlane deploy_playstore
- name: Upload Universal APK to Github
id: create_app_bundle
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]
with:
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Production Release
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 }}
action: 'create-asana-task'
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ annotation class ContributesRemoteFeature(
val featureName: String,

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

/** The class that implements the [FeatureExceptions.Store] interface */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
minSupportedVersion = feature.minSupportedVersion,
targets = emptyList(),
cohorts = emptyList(),
settings = feature.settings?.toString(),
)
)
Expand Down Expand Up @@ -528,7 +529,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
weight = cohort.weight,
)
} ?: emptyList()
val config = jsonToggle?.config ?: emptyMap()
val settings = jsonToggle?.settings?.toString()
this.feature.get().invokeMethod(subfeature.key).setRawStoredState(
Toggle.State(
remoteEnableState = newStateValue,
Expand All @@ -539,7 +540,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
assignedCohort = previousAssignedCohort,
targets = targets,
cohorts = cohorts,
config = config,
settings = settings,
),
)
} catch(e: Throwable) {
Expand Down Expand Up @@ -781,10 +782,7 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
"cohorts",
List::class.asClassName().parameterizedBy(FqName("JsonToggleCohort").asClassName(module)),
)
.addParameter(
"config",
Map::class.asClassName().parameterizedBy(String::class.asClassName(), String::class.asClassName()),
)
.addParameter("settings", FqName("org.json.JSONObject").asClassName(module).copy(nullable = true))
.build(),
)
.addProperty(
Expand Down Expand Up @@ -819,8 +817,8 @@ class ContributesRemoteFeatureCodeGenerator : CodeGenerator {
)
.addProperty(
PropertySpec
.builder("config", Map::class.asClassName().parameterizedBy(String::class.asClassName(), String::class.asClassName()))
.initializer("config")
.builder("settings", FqName("org.json.JSONObject").asClassName(module).copy(nullable = true))
.initializer("settings")
.build(),
)
.build()
Expand Down
Loading

0 comments on commit 214808a

Please sign in to comment.