Skip to content

Commit

Permalink
Added workflow to automaticall publish releases to maven central, rem…
Browse files Browse the repository at this point in the history
…oved bintray.
  • Loading branch information
saifkhichi96 committed Jun 26, 2022
1 parent 2c28a79 commit f793660
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 27 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish

on:
release:
# We'll run this workflow when a new GitHub release is created
types: [ released ]

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :tiles:assembleRelease

# Generates other artifacts
- name: Source jar and dokka
run: ./gradlew androidSourcesJar

# Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ buildscript {
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

allprojects {
repositories {
jcenter()
Expand All @@ -28,4 +32,6 @@ allprojects {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}
}

apply from: 'https://raw.githubusercontent.com/saifkhichi96/template-files/main/android/gradle/publish-root.gradle'
47 changes: 21 additions & 26 deletions tiles/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,27 @@ tasks.withType(Javadoc) {
options.addStringOption('charSet', 'UTF-8')
}

// For Bintray and JCenter distribution
// for maven central distribution
ext {
bintrayRepo = 'maven'
bintrayName = 'tiled'

publishedGroupId = 'dev.aspirasoft.apis'
libraryName = 'Tiled'
artifact = 'tiled'

libraryDescription = 'A lightweight library for creating simple tilemap-based UIs in Android.'

siteUrl = 'https://github.com/saifkhichi96/tiled'
gitUrl = 'https://github.com/saifkhichi96/tiled.git'

libraryVersion = '0.0.1'

developerId = 1
developerName = 'Muhammad Saif Ullah Khan'
developerEmail = '[email protected]'
organization = 'saifkhichi96'
licenseName = 'MIT License'
licenseUrl = 'https://opensource.org/licenses/MIT'
allLicenses = ["MIT"]
PUBLISH_GROUP_ID = 'dev.aspirasoft.apis'
PUBLISH_VERSION = '0.0.1'
PUBLISH_ARTIFACT_ID = 'tiled'
PUBLISH_ARTIFACT_DESC = 'A lightweight library for creating simple tilemap-based UIs in Android.'
PUBLISH_ARTIFACT_URL = 'https://github.com/aspirasoft/tiled'
PUBLISH_ARTIFACT_LICENSE = {
name = 'MIT License'
url = 'https://github.com/aspirasoft/tiled/blob/master/LICENSE'
}
PUBLISH_ARTIFACT_AUTHOR = {
id = 'saifkhichi96'
name = 'Saif Khan'
email = '[email protected]'
}
PUBLISH_ARTIFACT_VCS = {
connection = 'scm:git:github.com/aspirasoft/tiled.git'
developerConnection = 'scm:git:ssh://github.com/aspirasoft/tiled.git'
url = 'https://github.com/aspirasoft/tiled/tree/master'
}
}


// Bintray configuration
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/install.gradle'
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/bintray.gradle'
apply from: 'https://raw.githubusercontent.com/saifkhichi96/template-files/main/android/gradle/publish-module.gradle'

0 comments on commit f793660

Please sign in to comment.