Skip to content

Commit

Permalink
Merge pull request #99 from adobe/dev-v3.x
Browse files Browse the repository at this point in the history
Merge `dev-v3.x` into `staging` for 3.0.0.beta.1-SNAPSHOT release
  • Loading branch information
prudrabhat authored Mar 8, 2024
2 parents 44e07cd + 4cfdcfc commit 54f5ac9
Show file tree
Hide file tree
Showing 164 changed files with 9,982 additions and 8,660 deletions.
44 changes: 27 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
version: 2.1

orbs:
android: circleci/[email protected]
android: circleci/[email protected]
codecov: codecov/[email protected]

workflows:
version: 2
aepsdk-core-ci:
aepsdk-assurance-ci:
jobs:
- build-and-unit-test
- functional-test

jobs:
build-and-unit-test:
executor:
name: android/android-machine
name: android/android-docker
resource-class: large
tag: 2022.01.1
tag: 2024.01.1

steps:
- checkout
Expand All @@ -25,39 +26,48 @@ jobs:
command: make checkformat

- run:
name: Generate release build
command: make generate-library-release
name: Assemble Phone Release
command: make assemble-phone-release

- run:
name: Generate JavaDoc
command: make javadoc
name: Run Assurance Unit Tests with coverage
command: make unit-test-coverage

- run:
name: Run Unit tests
command: make unit-test
- codecov/upload:
file: ./code/assurance/build/reports/coverage/test/phone/debug/report.xml
flags: unit-tests

- store_test_results:
path: code/assurance/build/test-results/

- store_artifacts:
path: code/assurance/build/reports

- store_test_results:
path: code/assurance/build/test-results/testPhoneDebugUnitTest
- run:
name: Generate JavaDoc
command: make javadoc


functional-test:
executor:
name: android/android-machine
resource-class: large
tag: 2022.01.1
tag: 2024.01.1

steps:
- checkout

- android/start-emulator-and-run-tests:
system-image: system-images;android-29;default;x86
post-emulator-launch-assemble-command: make build-release
test-command: make functional-test
post-emulator-launch-assemble-command: make assemble-phone-release
test-command: make functional-test-coverage

- codecov/upload:
file: "./code/core/build/reports/coverage/androidTest/phone/debug/connected/report.xml"
flags: functional-tests

- store_artifacts:
path: code/assurance/build/reports

- store_test_results:
path: code/assurance/build/outputs/androidTest-results
path: code/assurance/build/outputs/androidTest-results
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
53 changes: 44 additions & 9 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,69 @@
name: Publish package to the Maven Central Repository
name: Publish Release

on:
push:
branches:
- main
## Manual Workflow trigger
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true

action_tag:
description: 'Create tag? ("no" to skip)'
required: true
default: 'yes'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Verify version
run: |
set -eo pipefail
echo Release version: ${{ github.event.inputs.tag }}
(./scripts/version.sh -v ${{ github.event.inputs.tag }})
- name: Import GPG key
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central repository
- name: Publish to Maven Central Repository
run: make ci-publish-main
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}

- name: Create GitHub Release
id: create_release
uses: release-drafter/release-drafter@v5
if: ${{ github.event.inputs.action_tag == 'yes' }}
with:
name: v${{ github.event.inputs.tag }}
tag: v${{ github.event.inputs.tag }}
version: v${{ github.event.inputs.tag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 15 additions & 8 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
name: Publish package to the Maven Central Staging Repository
name: Publish Snapshot

on:
push:
branches:
- staging
## Manual Workflow trigger
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Import GPG key
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central staging repository
- name: Publish to Maven Central Staging Repository
run: make ci-publish-staging
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Extension Version
on:
workflow_dispatch:
inputs:
version:
description: 'New version to use for the Assurance extension. Example: 3.0.0'
required: true


core-dependency:
description: '[Optional] Update Core dependency in pom.xml. Example: 3.0.0'
required: false

jobs:
update-version:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update Versions
run: (./scripts/version.sh -u -v ${{ github.event.inputs.version }} -d "Core ${{ github.event.inputs.core-dependency }}")

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ github.token }}
commit-message: Updating version to ${{ github.event.inputs.version }}.
branch: version-${{ github.event.inputs.version }}-update
delete-branch: true
title: Updating version to ${{ github.event.inputs.version }}
body: Updating version to ${{ github.event.inputs.version }}
43 changes: 24 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ EXTENSION-LIBRARY-FOLDER-NAME = assurance
TEST-APP-FOLDER-NAME = assurance-testapp
TEST-APP-DEBUG-APK = assurance-testapp-debug.apk

BUILD-ASSEMBLE-LOCATION = ./ci/assemble
ROOT_DIR=$(shell git rev-parse --show-toplevel)

PROJECT_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleProjectName" | cut -d'=' -f2)
SOURCE_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)
AAR_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)/build/outputs/aar
AAR_FILE_DIR = $(ROOT_DIR)/code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build/outputs/aar
TEST_APP_APK_OUTPUT_DIR = $(ROOT_DIR)/code/$(TEST-APP-FOLDER-NAME)/build/outputs/apk
ARTIFACTS_DIR = $(ROOT_DIR)/artifacts

Expand All @@ -21,10 +18,8 @@ checkformat:
format:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessApply)

build:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhone)

## This is a custom app build command to generate and copy the test app apk
## Use assemble-app for general usecases
build-app:
(./code/gradlew -p code clean)
# Delete TEST-APP-DEBUG-APK-NAME from the contents of ARTIFACTS_DIR
Expand All @@ -37,32 +32,42 @@ build-app:
(cp -r $(TEST_APP_APK_OUTPUT_DIR)/debug/$(TEST-APP-DEBUG-APK) $(ARTIFACTS_DIR))

unit-test:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) platformUnitTestJacocoReport)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) testPhoneDebugUnitTest)

unit-test-coverage:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) createPhoneDebugUnitTestCoverageReport)

functional-test:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) uninstallPhoneDebugAndroidTest)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) connectedPhoneDebugAndroidTest platformFunctionalTestJacocoReport)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) connectedPhoneDebugAndroidTest)

functional-test-coverage:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) uninstallPhoneDebugAndroidTest)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) createPhoneDebugAndroidTestCoverageReport)

javadoc:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) javadocPublic)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) javadocJar)

assemble-phone:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhone)

generate-library-debug:
assemble-phone-debug:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneDebug)

generate-library-release:
assemble-phone-release:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneRelease)

build-release:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} clean lint assemblePhoneRelease)
assemble-app:
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) assemble)

ci-publish-staging: clean build-release
ci-publish-staging: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository --stacktrace)

ci-publish-main: clean build-release
ci-publish-main: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository -Prelease)

ci-publish-maven-local: clean build-release
ci-publish-maven-local: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToMavenLocal -x signReleasePublication)

ci-publish-jitpack: clean build-release
ci-publish-maven-local-jitpack: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication)
Loading

0 comments on commit 54f5ac9

Please sign in to comment.