Skip to content

Commit

Permalink
Release 6.9.1 (#1073)
Browse files Browse the repository at this point in the history
* Remove unsafe send error email for EmbraceAutomaticVerification (#1049)

(cherry picked from commit 612354b)

* Fix missing sdk_version reading it from gradle.properties in kts file (#1072)

(cherry picked from commit e4695b0)

* Use token user and password for Sonatype publishing (#1048)

## Goal
Use token user and password for publishing per [new Maven Central requirements](https://central.sonatype.org/news/20240617_migration_of_accounts/#the-impact-on-ossrh-and-the-central-publisher-portal)

I generated the token user and password per instructions [here](https://central.sonatype.org/publish/generate-token/) and added them to the repo as a secret that I now reference in the workflows, which is this change.

(cherry picked from commit b075f14)

* Consolidate release workflows

---------

Co-authored-by: Nelsito <nelson.puglisi@protonmail.com>
Co-authored-by: Hanson Ho <hanson.ho@embrace.io>
  • Loading branch information
3 people authored Jul 10, 2024
1 parent fd143e7 commit dfd9eb9
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 171 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/build-rc-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Pre-Release - Create New Release Candidates
name: Pre-Release - Create New Release Candidate

env:
SONATYPE_USERNAME: embrace-io
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_USER_PASSWORD }}
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_ANDROID_SIGNING_KEY }}
Expand All @@ -20,6 +20,10 @@ on:
version_of_rc:
description: 'Version to create new RC for. Specify <major.minor> only, e.g. 6.3'
required: true
patch_number:
description: 'Patch number. e.g. for 6.3.1, use "1". Defaults to 0'
default: '0'
required: true

jobs:
release:
Expand All @@ -30,17 +34,10 @@ jobs:
jdk-version: [ "17" ]
ndk-version: [ "21.4.7075529" ]
steps:
- name: Decode Keystore
run: |
mkdir "$RUNNER_TEMP"/keystore
echo $mavenSigningKeyRingFileEncoded | base64 -di > "$RUNNER_TEMP"/keystore/2DE631C1.gpg
echo "mavenSigningKeyRingFile=$RUNNER_TEMP/keystore/2DE631C1.gpg" >> $GITHUB_ENV
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
Expand Down Expand Up @@ -88,8 +85,8 @@ jobs:

- name: Set version tag in SDK
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.0
git tag -f ${{ github.event.inputs.version_of_rc }}.0
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags
- name: Checkout Swazzler
Expand All @@ -105,8 +102,8 @@ jobs:
- name: Set version tag in Swazzler
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.0
git tag -f ${{ github.event.inputs.version_of_rc }}.0
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags
- name: Cleanup Gradle Cache
Expand Down
113 changes: 0 additions & 113 deletions .github/workflows/pre-patch-workflow.yml

This file was deleted.

11 changes: 1 addition & 10 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: Pre-Release - Cut Release Branch and Publish Release Candidate

env:
SONATYPE_USERNAME: embrace-io
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_ANDROID_SIGNING_KEY }}
mavenSigningKeyRingFileEncoded: ${{ secrets.MAVEN_ANDROID_GPG_KEY }}
mavenSigningKeyPassword: ${{ secrets.MAVEN_ANDROID_SIGNING_PASSWORD }}

on:
workflow_dispatch:
inputs:
Expand All @@ -28,7 +19,7 @@ jobs:
version_to_release: ${{ github.event.inputs.version_to_release }}
next_version: ${{ github.event.inputs.next_version }}

release-candate:
release-candidate:
name: Create Release Candidate
needs: release-branch
uses: ./.github/workflows/build-rc-workflow.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rc-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rc-update-test-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout App
uses: actions/checkout@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release - Release RC and Update Documentation

env:
SONATYPE_USERNAME: embrace-io
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_USER_PASSWORD }}
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_ANDROID_SIGNING_KEY }}
Expand Down Expand Up @@ -56,7 +56,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Publish gh-pages
run: |
Expand Down
5 changes: 4 additions & 1 deletion embrace-android-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ plugins {

description = "Embrace Android SDK: Core"

val version: String by project


android {
useLibrary("android.test.runner")
useLibrary("android.test.base")
Expand All @@ -24,7 +27,7 @@ android {
// For library projects only, the BuildConfig.VERSION_NAME and BuildConfig.VERSION_CODE properties have been removed from the generated BuildConfig class
//
// https://developer.android.com/studio/releases/gradle-plugin#version_properties_removed_from_buildconfig_class_in_library_projects
buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"")
buildConfigField("String", "VERSION_NAME", "\"${version}\"")
buildConfigField("String", "VERSION_CODE", "\"${53}\"")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.app.Activity
import android.app.AlertDialog
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.os.Looper
import android.widget.Toast
Expand Down Expand Up @@ -54,7 +53,6 @@ internal class EmbraceAutomaticVerification(
companion object {
internal const val TAG = "[EmbraceVerification]"
private const val ON_FOREGROUND_DELAY = 5000L
private const val EMBRACE_CONTACT_EMAIL = "support@embrace.io"
private const val VERIFY_INTEGRATION_DELAY = 200L
private const val ON_FOREGROUND_TIMEOUT = 5000L
internal val instance = EmbraceAutomaticVerification()
Expand Down Expand Up @@ -292,10 +290,6 @@ internal class EmbraceAutomaticVerification(
.setTitle(activity.getString(R.string.automatic_verification_error_title))
.setMessage(errorString)
.setCancelable(true)
.setNegativeButton(activity.getString(R.string.send_error_log)) { dialog, _ ->
sendErrorLog(activity, errorString)
dialog.dismiss()
}
.setPositiveButton(activity.getString(R.string.close)) { dialog, _ ->
dialog.dismiss()
}
Expand All @@ -305,28 +299,6 @@ internal class EmbraceAutomaticVerification(
}
}

private fun sendErrorLog(activity: Activity, errorMessage: String) {
val errorLog = generateErrorLog(errorMessage)
val selectorIntent = Intent(Intent.ACTION_SENDTO).setData(Uri.parse("mailto:$EMBRACE_CONTACT_EMAIL"))

val emailIntent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_EMAIL, arrayOf(EMBRACE_CONTACT_EMAIL))
putExtra(Intent.EXTRA_SUBJECT, "Android Verification Log")
putExtra(Intent.EXTRA_TEXT, errorLog)
selector = selectorIntent
}

activity.startActivity(Intent.createChooser(emailIntent, "Send Email"))
}

private fun generateErrorLog(errorMessage: String): String {
var errorLog = "App ID: ${Embrace.getImpl().metadataService?.getAppId()}\n" +
"App Version: ${Embrace.getImpl().metadataService?.getAppVersionName()}"
errorLog += "\n\n-----------------\n\n"
errorLog += errorMessage
return errorLog
}

private fun logInfo(message: String) {
Embrace.getInstance().internalInterface.logInfo("$TAG $message", null)
}
Expand Down

0 comments on commit dfd9eb9

Please sign in to comment.