1+ name : Release - Nightly Release to Internal and Firebase
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 2 * * *' # run at 3 AM UTC
6+ workflow_dispatch :
7+
8+ env :
9+ ASANA_PAT : ${{ secrets.GH_ASANA_SECRET }}
10+ GOOGLE_APPLICATION_CREDENTIALS : ' #{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json'
11+
12+ jobs :
13+ create-tag :
14+ name : Generate and upload nightly bundle to Play Store Internal track
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+ with :
21+ submodules : recursive
22+ 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 }}'
28+
29+ - name : Set up JDK 17
30+ uses : actions/setup-java@v4
31+ with :
32+ java-version : ' 17'
33+ distribution : ' adopt'
34+
35+ - name : Set up ruby env
36+ uses : ruby/setup-ruby@v1
37+ with :
38+ ruby-version : 2.7.2
39+ bundler-cache : true
40+
41+ - name : Get latest tag
42+ id : get_latest_tag
43+ run : |
44+ git fetch --tags
45+ output=$(git describe --tags `git rev-list --tags --max-count=1`)
46+ echo "Latest tag: $output"
47+ echo "latest_tag=$output" >> $GITHUB_OUTPUT
48+
49+ - name : Decode upload keys
50+ uses : davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
51+ with :
52+ secret : ${{ secrets.UPLOAD_RELEASE_PROPERTIES }}
53+ fileName : ddg_android_build_upload.properties
54+ destination-path : $HOME/jenkins_static/com.duckduckgo.mobile.android/
55+
56+ - name : Decode key file
57+ uses : davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
58+ with :
59+ secret : ${{ secrets.UPLOAD_RELEASE_KEY }}
60+ fileName : ddg-upload-keystore.jks
61+ destination-path : $HOME/jenkins_static/com.duckduckgo.mobile.android/
62+
63+ - name : Decode Play Store credentials file
64+ uses : davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
65+ with :
66+ secret : ${{ secrets.UPLOAD_PLAY_CREDENTIALS }}
67+ fileName : api.json
68+ destination-path : $HOME/jenkins_static/com.duckduckgo.mobile.android/
69+
70+ - name : Decode Firebase credentials file
71+ uses : davidSchuppa/base64Secret-toFile-action@199e78f212c854d2284fada7f3cd3aba3e37d208
72+ with :
73+ secret : ${{ secrets.UPLOAD_FIREBASE_CREDENTIALS }}
74+ fileName : ddg-upload-firebase.json
75+ destination-path : $HOME/jenkins_static/com.duckduckgo.mobile.android/
76+
77+ - name : Clean project
78+ run : |
79+ gradle clean
80+
81+ - name : Assemble the bundle
82+ run : gradle bundleInternalRelease -PversionNameSuffix=-nightly -PuseUploadSigning -PlatestTag=${{ steps.get_latest_tag.outputs.latest_tag }}
83+
84+ - name : Generate nightly version name
85+ id : generate_version_name
86+ run : |
87+ output=$(gradle getBuildVersionName -PversionNameSuffix=-nightly -PlatestTag=${{ steps.get_latest_tag.outputs.latest_tag }} --quiet | tail -n 1)
88+ echo "version=$output" >> $GITHUB_OUTPUT
89+
90+ - name : Capture App Bundle Path
91+ id : capture_output
92+ run : |
93+ output=$(find app/build/outputs/bundle/internalRelease -name "*.aab")
94+ echo "bundle_path=$output" >> $GITHUB_OUTPUT
95+
96+ - name : Upload bundle to Play Store Internal track
97+ id : create_app_bundle
98+ run : |
99+ bundle exec fastlane deploy_dogfood aab_path:${{ steps.capture_output.outputs.bundle_path }}
100+
101+ - name : Tag Nightly release
102+ id : tag_nightly_release
103+ run : |
104+ git tag -a ${{ steps.generate_version_name.outputs.version }} -m "Create tag ${{ steps.generate_version_name.outputs.version }} for nightly release."
105+ git push origin ${{ steps.generate_version_name.outputs.version }}
106+
107+ - name : Upload APK as artifact
108+ uses : actions/upload-artifact@v4
109+ with :
110+ name : duckduckgo-${{ steps.generate_version_name.outputs.version }}.apk
111+ path : duckduckgo.apk
112+
113+ - name : Create Asana task when workflow failed
114+ if : ${{ failure() }}
115+ uses : duckduckgo/native-github-asana-sync@v1.1
116+ with :
117+ asana-pat : ${{ secrets.GH_ASANA_SECRET }}
118+ asana-project : ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
119+ asana-section : ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
120+ asana-task-name : GH Workflow Failure - Nightly Release
121+ asana-task-description : The Nightly Release Task workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
122+ action : ' create-asana-task'
0 commit comments