Skip to content

Commit

Permalink
fix: sdk publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
abd3lraouf committed Jul 16, 2022
1 parent 06de983 commit 9382aaa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
# If this run was triggered by a pull request event then checkout
# the head of the pull request instead of the merge commit.
# Only include this step if you are running this workflow on pull requests.
- run: git checkout HEAD^2
- name: Checkout pull request head
run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
- name: Set up JDK 11
uses: actions/setup-java@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
uses: gradle/wrapper-validation-action@v1
- name: Run Semantic Release
run: |
mkdir ~/.gradle
echo "gpr.user=abd3lraouf" >> ~/.gradle/gradle.properties
echo "gpr.key=${{ secrets.GITHUB_TOKEN }}" >> ~/.gradle/gradle.properties
rm -rf build/libs/*.jar
npm ci
npx semantic-release
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# 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
android.nonTransitiveRClass=true
# Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
android.disableAutomaticComponentCreation=true
27 changes: 27 additions & 0 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id 'org.sonarqube' version '3.4.0.2513'
id 'com.dicedmelon.gradle.jacoco-android'
id 'com.github.spotbugs'
id 'maven-publish'
}

android {
Expand Down Expand Up @@ -72,6 +73,32 @@ static String slashSeparated(String s) {
return s.replaceAll(/\B[A-Z]/) { '/' + it }.toLowerCase()
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/abd3lraouf/Semantic")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'dev.abd3lraouf.learn.Semantic'
artifactId "$project.name"
from components.findByName("all")
}
}
}

task comps {
afterEvaluate {
println("Components: " + components*.name)
}
}

dependencies {

implementation 'androidx.core:core-ktx:1.8.0'
Expand Down

0 comments on commit 9382aaa

Please sign in to comment.