-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Duy Phạm
authored and
Duy Phạm
committed
Nov 7, 2024
1 parent
6c870f0
commit 640af61
Showing
3 changed files
with
165 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,104 @@ | ||
version: 2.1 | ||
orbs: | ||
gradle: circleci/gradle@2.2.0 | ||
android: circleci/android@2.2.0 | ||
|
||
jobs: | ||
run-tests-generate-samples: | ||
executor: | ||
name: android/android-machine | ||
resource-class: large | ||
tag: 2023.05.1 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: jars2-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
- run: | ||
name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. | ||
command: sudo chmod +x ./gradlew | ||
- run: | ||
name: Wrapper | ||
command: ./gradlew wrapper | ||
- run: | ||
name: Download Dependencies | ||
command: ./gradlew androidDependencies | ||
- save_cache: | ||
paths: | ||
- ~/.gradle | ||
key: jars2-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
|
||
- android/create-avd: | ||
avd-name: testDevice | ||
system-image: system-images;android-30;google_apis;x86_64 | ||
install: true | ||
additional-args: --device pixel_4 | ||
|
||
- android/start-emulator: | ||
avd-name: testDevice | ||
no-window: true | ||
restore-gradle-cache-prefix: v2a | ||
|
||
- android/run-tests: | ||
test-command: ./gradlew lib:connectedDebugAndroidTest | ||
max-tries: 3 | ||
- android/save-gradle-cache: | ||
cache-prefix: v2a | ||
- store_test_results: | ||
path: lib/build/outputs/androidTest-results | ||
deploy-to-sonatype: | ||
executor: | ||
name: android/android-machine | ||
resource-class: large | ||
tag: 2023.05.1 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
- run: | ||
name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. | ||
command: sudo chmod +x ./gradlew | ||
- run: | ||
name: Wrapper | ||
command: ./gradlew wrapper | ||
- run: | ||
name: Download Dependencies | ||
command: ./gradlew androidDependencies | ||
- save_cache: | ||
paths: | ||
- ~/.gradle | ||
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
- run: | ||
name: Force break line gradle properties | ||
command: echo -e '\n' >> gradle.properties | ||
- run: | ||
name: Inject Maven signing key | ||
command: | | ||
echo $GPG_SIGNING_KEY \ | ||
| awk 'NR == 1 { print "SIGNING_KEY=" } 1' ORS='\\n' \ | ||
>> gradle.properties | ||
- run: | ||
name: Snapshot Release Check | ||
command: | | ||
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^epic.* ]] && echo true || echo false )" >> gradle.properties | ||
- run: | ||
name: Publish to Maven | ||
command: ./gradlew assemble publish | ||
workflows: | ||
build-test-sonar-publish: | ||
jobs: | ||
- run-tests-generate-samples: | ||
context: | ||
- SonarCloud | ||
- maven-sign | ||
- mobile | ||
- deploy-to-sonatype: | ||
name: Build, run tests, sonar and push to maven staging | ||
context: | ||
- SonarCloud | ||
- maven-sign | ||
- mobile | ||
filters: | ||
branches: | ||
only: | ||
- /^(epic)\/.*/ | ||
- staging | ||
#version: 2.1 | ||
#orbs: | ||
# gradle: circleci/gradle@2.2.0 | ||
# android: circleci/android@2.2.0 | ||
# | ||
#jobs: | ||
# run-tests-generate-samples: | ||
# executor: | ||
# name: android/android-machine | ||
# resource-class: large | ||
# tag: 2023.05.1 | ||
# steps: | ||
# - checkout | ||
# - restore_cache: | ||
# key: jars2-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
# - run: | ||
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. | ||
# command: sudo chmod +x ./gradlew | ||
# - run: | ||
# name: Wrapper | ||
# command: ./gradlew wrapper | ||
# - run: | ||
# name: Download Dependencies | ||
# command: ./gradlew androidDependencies | ||
# - save_cache: | ||
# paths: | ||
# - ~/.gradle | ||
# key: jars2-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
# | ||
# - android/create-avd: | ||
# avd-name: testDevice | ||
# system-image: system-images;android-30;google_apis;x86_64 | ||
# install: true | ||
# additional-args: --device pixel_4 | ||
# | ||
# - android/start-emulator: | ||
# avd-name: testDevice | ||
# no-window: true | ||
# restore-gradle-cache-prefix: v2a | ||
# | ||
# - android/run-tests: | ||
# test-command: ./gradlew lib:connectedDebugAndroidTest | ||
# max-tries: 3 | ||
# - android/save-gradle-cache: | ||
# cache-prefix: v2a | ||
# - store_test_results: | ||
# path: lib/build/outputs/androidTest-results | ||
# deploy-to-sonatype: | ||
# executor: | ||
# name: android/android-machine | ||
# resource-class: large | ||
# tag: 2023.05.1 | ||
# steps: | ||
# - checkout | ||
# - restore_cache: | ||
# key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
# - run: | ||
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. | ||
# command: sudo chmod +x ./gradlew | ||
# - run: | ||
# name: Wrapper | ||
# command: ./gradlew wrapper | ||
# - run: | ||
# name: Download Dependencies | ||
# command: ./gradlew androidDependencies | ||
# - save_cache: | ||
# paths: | ||
# - ~/.gradle | ||
# key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "lib/build.gradle.kts" }} | ||
# - run: | ||
# name: Force break line gradle properties | ||
# command: echo -e '\n' >> gradle.properties | ||
# - run: | ||
# name: Inject Maven signing key | ||
# command: | | ||
# echo $GPG_SIGNING_KEY \ | ||
# | awk 'NR == 1 { print "SIGNING_KEY=" } 1' ORS='\\n' \ | ||
# >> gradle.properties | ||
# - run: | ||
# name: Snapshot Release Check | ||
# command: | | ||
# echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^epic.* ]] && echo true || echo false )" >> gradle.properties | ||
# - run: | ||
# name: Publish to Maven | ||
# command: ./gradlew assemble publish | ||
#workflows: | ||
# build-test-sonar-publish: | ||
# jobs: | ||
# - run-tests-generate-samples: | ||
# context: | ||
# - SonarCloud | ||
# - maven-sign | ||
# - mobile | ||
# - deploy-to-sonatype: | ||
# name: Build, run tests, sonar and push to maven staging | ||
# context: | ||
# - SonarCloud | ||
# - maven-sign | ||
# - mobile | ||
# filters: | ||
# branches: | ||
# only: | ||
# - /^(epic)\/.*/ | ||
# - staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and Deploy to SonarType | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'staging' | ||
- 'epic/**' | ||
- 'task/**' | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Enable KVM group perms | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
ls /dev/kvm | ||
- name: Setup Java 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' # See 'Supported distributions' for available options | ||
java-version: '17' | ||
|
||
- name: Restore gradle.properties | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
SIGNING_KEY_PWD: ${{ secrets.SIGNING_KEY_PWD }} | ||
shell: bash | ||
run: | | ||
mkdir -p ~/.gradle/ | ||
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV | ||
echo "OSSRH_USERNAME=${OSSRH_USERNAME}">> ~/.gradle/gradle.properties | ||
echo "OSSRH_PASSWORD=${OSSRH_PASSWORD}">> ~/.gradle/gradle.properties | ||
echo "GPG_SIGNING_KEY=${GPG_SIGNING_KEY}">> ~/.gradle/gradle.properties | ||
echo "SIGNING_KEY_PWD=${SIGNING_KEY_PWD}">> ~/.gradle/gradle.properties | ||
# - name: Force break line gradle properties | ||
# run: echo -e '\n' >> gradle.properties | ||
|
||
# - run: | ||
# name: Inject Maven signing key | ||
# command: | | ||
# echo $GPG_SIGNING_KEY \ | ||
# | awk 'NR == 1 { print "SIGNING_KEY=" } 1' ORS='\\n' \ | ||
# >> gradle.properties | ||
|
||
- name: Snapshot Release Check | ||
run: | | ||
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^task.* ]] && echo true || echo false )" >> gradle.properties | ||
- name: Publish to Maven | ||
run: ./gradlew assemble publish |