Skip to content

Commit

Permalink
Merge pull request #16 from middleware-labs/init-sdk
Browse files Browse the repository at this point in the history
🎨 Added build workflow & refactor publish process
  • Loading branch information
Archish27 authored Nov 27, 2023
2 parents fca1454 + a3ae159 commit 528814e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build SDK

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Java 17 for running Gradle
uses: actions/[email protected]
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
19 changes: 10 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: release

on:
push:
branches:
- main
workflow_dispatch:
inputs:
versionName:
description: 'Version Name'
required: true

jobs:
publish:
Expand All @@ -12,7 +13,7 @@ jobs:

steps:
- uses: actions/[email protected]
- name: Set up JDK 11 for running Gradle
- name: Set up Java 17 for running Gradle
uses: actions/[email protected]
with:
distribution: temurin
Expand All @@ -31,9 +32,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 }}
Expand All @@ -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
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions sdk/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELEASE_SIGNING_ENABLED=true
SONATYPE_HOST=S01
SONATYPE_AUTOMATIC_RELEASE=true

0 comments on commit 528814e

Please sign in to comment.