-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from pseudoankit/publish-maven-central
publish to maven central
- Loading branch information
Showing
6 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish | ||
|
||
# This block defines that action will be triggered when we do a github release | ||
on: | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Publish Artifact | ||
env: | ||
# fetching the release version tag | ||
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} | ||
OSS_USERNAME: ${{ secrets.OSS_USERNAME }} | ||
OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }} | ||
OSS_STAGING_PROFILE_ID: ${{ secrets.OSS_STAGING_PROFILE_ID }} | ||
OSS_SIGNING_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID }} | ||
OSS_SIGNING_PASSWORD: ${{ secrets.OSS_SIGNING_PASSWORD }} | ||
OSS_SIGNING_KEY: ${{ secrets.OSS_SIGNING_KEY }} | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
ext { | ||
GROUP_ID = "io.github.pseudoankit" | ||
VERSION = (System.getenv("RELEASE_TAG_NAME") ?: "SNAPSHOT").replace("v", "") | ||
|
||
SITE_URL = 'https://github.com/pseudoankit/ratingbar-compose' | ||
GIT_URL = 'https://github.com/pseudoankit/ratingbar-compose.git' | ||
|
||
POM_DESCRIPTION = "Compose library to add rating bar" | ||
POM_URL = SITE_URL | ||
} | ||
|
||
signing { | ||
useInMemoryPgpKeys( | ||
System.getenv("OSS_SIGNING_KEY_ID"), | ||
System.getenv("OSS_SIGNING_KEY"), | ||
System.getenv("OSS_SIGNING_PASSWORD"), | ||
) | ||
sign publishing.publications | ||
} | ||
|
||
// If you want to publish your sources as well | ||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
|
||
groupId GROUP_ID | ||
artifactId ARTIFACT_ID | ||
version VERSION | ||
|
||
from components.release | ||
artifact androidSourcesJar | ||
|
||
pom { | ||
name = ARTIFACT_ID | ||
description = POM_DESCRIPTION | ||
url = POM_URL | ||
licenses { | ||
license { | ||
name = "The Apache Software License, Version 2.0" | ||
url = "https://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'pseudoankit' | ||
name = 'Ankit Kumar' | ||
email = '[email protected]' | ||
} | ||
} | ||
|
||
scm { | ||
connection = GIT_URL | ||
developerConnection = GIT_URL | ||
url = SITE_URL | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters