diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..707f56e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: Publish +on: + workflow_dispatch: + push: + tags: + - '*' +jobs: + maven: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '21' + cache: gradle + - name: Publish to Maven Central + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSPHRASE }} + ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: "true" + run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel --no-daemon diff --git a/build.gradle.kts b/build.gradle.kts index 17129b4..f64839a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { java + alias(libs.plugins.maven.publish) } dependencies { diff --git a/gradle.properties b/gradle.properties index 681a07b..730a511 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,8 @@ GROUP=pink.madis.apk.arsc VERSION_NAME=0.0.8-SNAPSHOT +SONATYPE_HOST=DEFAULT + POM_NAME=emulator.wtf Gradle Plugin POM_DESCRIPTION=Android Chunk format reader/writer POM_INCEPTION_YEAR=2017 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e0d9b7..b62e9fd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,10 @@ autovalue = "1.10.4" guava = "33.1.0-android" annotations = "24.1.0" +maven-publish = "0.28.0" [plugins] +maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" } [libraries] autovalue-compiler = { module = "com.google.auto.value:auto-value", version.ref = "autovalue" }