diff --git a/.github/workflows/android-sdk.yml b/.github/workflows/android-sdk.yml index 5edc6bf..5a2e743 100644 --- a/.github/workflows/android-sdk.yml +++ b/.github/workflows/android-sdk.yml @@ -21,12 +21,6 @@ env: GRADLE_VERSION: "7.5" JAVA_VERSION: "17" ARTIFACT_PATH: "VCL/build/outputs" - ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }} - ANDROID_NEXUS_SIGNING_PWD: ${{ secrets.ANDROID_NEXUS_SIGNING_PWD }} - ANDROID_NEXUS_OSSRH_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_USERNAME }} - ANDROID_NEXUS_OSSRH_PWD: ${{ secrets.ANDROID_NEXUS_OSSRH_PWD }} - ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }} - ANDROID_NEXUS_PRIVATE_KEY: ${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }} GLOBAL_ENV: ${{ github.event_name == 'push' && format('{0}', 'dev') || inputs.environment }} jobs: @@ -36,7 +30,7 @@ jobs: - name: Git clone repository uses: actions/checkout@v4 # Setup java - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} @@ -52,7 +46,7 @@ jobs: - name: Git clone repository uses: actions/checkout@v4 # Setup java - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ env.JAVA_VERSION }} @@ -69,16 +63,23 @@ jobs: # Show Me Builded packages - name: Show Me Builded packages run: ls -al ${{ env.ARTIFACT_PATH}}/${{ env.PACKAGE_TYPE }}/ + - name: Export Nexus Private Key + run: echo "signingPrivateKey=${{ secrets.ANDROID_NEXUS_PRIVATE_KEY }}" >> nexus.properties # Publish Prod/Rc - name: Publish Prod/Rc if: ${{ env.GLOBAL_ENV == 'prod' || env.GLOBAL_ENV == 'rc' }} run: ./gradlew publish${{ env.RELEASE_TAG }} env: RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'Release' ) || 'Rc' }} + ANDROID_NEXUS_OSSRH_USERNAME: ${{ secrets.ANDROID_NEXUS_OSSRH_USERNAME }} + ANDROID_NEXUS_OSSRH_PWD: ${{ secrets.ANDROID_NEXUS_OSSRH_PWD }} + ANDROID_NEXUS_SIGNING_KEY_ID: ${{ secrets.ANDROID_NEXUS_SIGNING_KEY_ID }} + ANDROID_NEXUS_SIGNING_PWD: ${{ secrets.ANDROID_NEXUS_SIGNING_PWD }} + ANDROID_NEXUS_STAGING_PROFILE_ID: ${{ secrets.ANDROID_NEXUS_STAGING_PROFILE_ID }} # Upload Artifacts - name: Upload Artifact if: success() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: vcl-${{ env.RELEASE_TAG }}.${{ env.PACKAGE_TYPE }} path: ${{ env.ARTIFACT_PATH }}/${{ env.PACKAGE_TYPE }} diff --git a/publish-core.gradle b/publish-core.gradle index 2685c32..dc50d1d 100644 --- a/publish-core.gradle +++ b/publish-core.gradle @@ -1,5 +1,9 @@ def propertiesFilePath = '/Volumes/Keybase/team/velocitycareers/mobile/android/maven/nexus.properties' +def propertiesFilePath_alternative = 'nexus.properties' + def propertiesFile = new File(propertiesFilePath) +def propertiesFile_alternative = new File(propertiesFilePath_alternative) + def properties = new Properties() if (propertiesFile.exists()) { @@ -8,8 +12,14 @@ if (propertiesFile.exists()) { } catch (IOException e) { e.printStackTrace() } +} else if (propertiesFile_alternative.exists()) { + try { + properties.load(new FileInputStream(propertiesFile_alternative)) + } catch (IOException e) { + e.printStackTrace() + } } else { - println "Properties file not found: $propertiesFilePath" + println "Properties file not found: $propertiesFilePath or $propertiesFilePath_alternative" } ext {