diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..194f487 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish package to GitHub Packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b + - name: Publish package + uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 + with: + arguments: publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 0293479..8754291 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,13 +4,12 @@ plugins { kotlin("jvm") version "1.7.20" kotlin("plugin.serialization") version "1.7.20" + `maven-publish` application } group = "com.radixdlt" -version = "1.0-SNAPSHOT" - - +version = "1.0-snapshot" repositories { mavenCentral() @@ -36,3 +35,24 @@ tasks.withType { application { mainClass.set("MainKt") } + +publishing { + publications { + create("mavenJava") { + groupId = project.group.toString() + artifactId = "slip10-android" + version = project.version.toString() + from(components["java"]) + } + } + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/radixdlt/slip10-android") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +}