Skip to content

Commit

Permalink
proper gh token for github deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
malmstein committed Nov 14, 2024
1 parent 850e51b commit e59e2ce
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 32 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/release_upload_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,7 @@ jobs:
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: update_bundle_play
run: |
bundle exec fastlane deploy_playstore
- name: Upload Universal APK to Github
id: update_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]
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'
99 changes: 99 additions & 0 deletions .github/workflows/release_upload_play_store_old.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: update_bundle_play
run: |
bundle exec fastlane deploy_playstore
- name: Upload Universal APK to Github
id: update_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]
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'
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ platform :android do
version = props["VERSION"]
releaseNotes = release_notes_github()
apkPath = "app/build/outputs/apk/play/release/duckduckgo-#{version}-play-release.apk"
token = ENV["GITHUB_UPLOAD_TOKEN"]
token = ENV["GH_TOKEN"]

UI.message ("Upload new app version to GitHub\nVersion: #{version}\nRelease Notes:\n=====\n#{releaseNotes}\n=====\n")

Expand Down

0 comments on commit e59e2ce

Please sign in to comment.