diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6b99bb2..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,81 +0,0 @@ -version: 2 -jobs: - build: - working_directory: ~/code - docker: - - image: cimg/android:2023.02 - resource_class: large - environment: - JVM_OPTS: -Xmx4800m - steps: - - checkout - - restore_cache: - key: jars-{{ checksum "build.gradle" }}-{{ checksum "hyperion-core/build.gradle" }} -# - run: -# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. -# command: sudo chmod +x ./gradlew - - run: - name: Download Dependencies - command: ./gradlew androidDependencies - - save_cache: - paths: - - ~/.gradle - key: jars-{{ checksum "build.gradle" }}-{{ checksum "hyperion-core/build.gradle" }} - - run: - name: Build - command: ./gradlew clean assemble - - run: - name: Check - command: ./gradlew lintRelease - - store_artifacts: - path: hyperion-core/build/outputs/ - destination: core - - store_artifacts: - path: hyperion-core-no-op/build/outputs/ - destination: core-no-op - - store_artifacts: - path: hyperion-plugin/build/outputs/ - destination: plugin - - store_artifacts: - path: hyperion-attr/build/outputs/ - destination: attr - - store_artifacts: - path: hyperion-attr-appcompat-v7/build/outputs/ - destination: attr-appcompat-v7 - - store_artifacts: - path: hyperion-attr-design/build/outputs/ - destination: attr-design - - store_artifacts: - path: hyperion-attr-recyclerview/build/outputs/ - destination: attr-recyclerview - - store_artifacts: - path: hyperion-attr-support-v4/build/outputs/ - destination: attr-support-v4 - - store_artifacts: - path: hyperion-disk/build/outputs/ - destination: disk - - store_artifacts: - path: hyperion-measurement/build/outputs/ - destination: measurement - - store_artifacts: - path: hyperion-phoenix/build/outputs/ - destination: phoenix - - store_artifacts: - path: hyperion-recorder/build/outputs/ - destination: recorder -# - store_test_results: -# path: app/build/test-results - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "develop" ]; then - echo "$MAVEN_CENTRAL_SEC_RING" | base64 -d > $HOME/secring.gpg - gpg --import --batch $HOME/secring.gpg - ./gradlew clean publish -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" -Psigning.keyId="$MAVEN_CENTRAL_KEY_ID" -Psigning.password="$MAVEN_CENTRAL_KEY_PASSPHRASE" -Psigning.secretKeyRingFile=$HOME/secring.gpg -Porg.gradle.parallel=false -Porg.gradle.daemon=false --no-daemon - fi - -workflows: - version: 2 - build: - jobs: - - build: - context: opensource-maven diff --git a/.github/workflows/mc-release.yml b/.github/workflows/mc-release.yml index 585cdbb..b33fb2d 100644 --- a/.github/workflows/mc-release.yml +++ b/.github/workflows/mc-release.yml @@ -2,8 +2,13 @@ name: Build & Release to Maven Central on: push: + branches: + - develop tags: - 'v*.*.*' + pull_request: + branches: + - develop jobs: build: @@ -29,6 +34,11 @@ jobs: - name: Lint Release run: ./gradlew lintRelease + - name: Extract Branch Name + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/}}" >> $GITHUB_OUTPUT + id: extract_branch + + # Check if the branch name matches the pattern "tags/v*.*.*" using regex - name: Deploy To Maven Central run: | echo ${{ secrets.MAVEN_CENTRAL_SEC_RING }} | base64 -d > $HOME/secring.gpg @@ -42,10 +52,12 @@ jobs: -Porg.gradle.parallel=false \ -Porg.gradle.daemon=false \ --no-daemon + if: success() && steps.extract_branch.outputs.branch == 'tags/v*.*.*' - name: Create Github Release uses: marvinpinto/action-automatic-releases@v1.2.1 with: repo_token: ${{ secrets.GITHUB_TOKEN }} prerelease: false + if: success() && steps.extract_branch.outputs.branch == 'tags/v*.*.*'