From c115a286ad3f976d16b09832201808902777e8f8 Mon Sep 17 00:00:00 2001 From: Archish Date: Mon, 27 Nov 2023 13:51:58 +0530 Subject: [PATCH 1/2] :art: Added build workflow & refactor publish process --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ .github/workflows/publish.yml | 4 ++-- gradle.properties | 2 -- sdk/gradle.properties | 3 +++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 sdk/gradle.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..247ddfa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - name: Set up JDK 11 for running Gradle + uses: actions/setup-java@v3.13.0 + with: + distribution: temurin + java-version: 17 + + - name: Grant Permission to Execute Gradle + run: chmod +x gradlew + + - name: Build with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: build \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f346f88..4353f26 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,9 +31,9 @@ jobs: echo "Publishing library🚀" ./gradlew publish --no-daemon --no-parallel echo "Published✅" - + echo "Releasing repository...🚀" - ./gradlew closeAndReleaseRepository --repository iogithubmiddleware-labs-1042 + ./gradlew closeAndReleaseRepository echo "Released✅" env: ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }} diff --git a/gradle.properties b/gradle.properties index 0ad674c..a03b354 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,5 +19,3 @@ android.useAndroidX=true # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -RELEASE_SIGNING_ENABLED=true -SONATYPE_HOST=S01 diff --git a/sdk/gradle.properties b/sdk/gradle.properties new file mode 100644 index 0000000..06b4da5 --- /dev/null +++ b/sdk/gradle.properties @@ -0,0 +1,3 @@ +RELEASE_SIGNING_ENABLED=true +SONATYPE_HOST=S01 +SONATYPE_AUTOMATIC_RELEASE=true From a3ae1596035d058032a38e7669afb36dcacc85d9 Mon Sep 17 00:00:00 2001 From: Archish Date: Mon, 27 Nov 2023 14:15:00 +0530 Subject: [PATCH 2/2] :art: added version name as required --- .github/workflows/build.yml | 6 +++--- .github/workflows/publish.yml | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 247ddfa..2b916fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,13 @@ -name: Run tests +name: Build SDK -on: [push, pull_request] +on: [pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.1 - - name: Set up JDK 11 for running Gradle + - name: Set up Java 17 for running Gradle uses: actions/setup-java@v3.13.0 with: distribution: temurin diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4353f26..3a79a01 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,10 @@ name: release - on: - push: - branches: - - main + workflow_dispatch: + inputs: + versionName: + description: 'Version Name' + required: true jobs: publish: @@ -12,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - - name: Set up JDK 11 for running Gradle + - name: Set up Java 17 for running Gradle uses: actions/setup-java@v3.13.0 with: distribution: temurin @@ -55,9 +56,9 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GHCR_TOKEN }} with: tag_name: ${{ github.event.inputs.versionName }} release_name: ${{ github.event.inputs.versionName }} - draft: true + draft: false prerelease: false