mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-07 22:26:29 -04:00
Merge 4751ef1565e9d1b7fffd35688b1cb4e80a685bd7 into fc5151e23a5e983f1a3d94fb59af00299bea87ab
This commit is contained in:
commit
2bc2966506
41
.github/workflows/publish_snapshot.yml
vendored
Normal file
41
.github/workflows/publish_snapshot.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Publish Snapshot to Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags-ignore:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: 11
|
||||
|
||||
- name: Install dependencies
|
||||
run: bash ./install_deps.sh
|
||||
|
||||
- name: Compile and prepare package
|
||||
run: |
|
||||
./gradlew buildHeaders build assemble androidSourcesJar
|
||||
|
||||
- name: Publish Snapshot 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 }}
|
||||
SNAPSHOT: true
|
17
build.gradle
17
build.gradle
@ -20,20 +20,3 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin'
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
Properties properties = new Properties()
|
||||
if (rootProject.file("local.properties").exists()) {
|
||||
properties.load(rootProject.file("local.properties").newDataInputStream())
|
||||
}
|
||||
// Publish to Maven Central
|
||||
nexusPublishing {
|
||||
repositories {
|
||||
sonatype {
|
||||
stagingProfileId = properties.getProperty("sonatypeStagingProfileId", System.getenv('SONATYPE_STAGING_PROFILE_ID'))
|
||||
username = properties.getProperty("ossrhUsername", System.getenv('OSSRH_USERNAME'))
|
||||
password = properties.getProperty("ossrhPassword", System.getenv('OSSRH_PASSWORD'))
|
||||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ ext["key"] = properties.getProperty("signing.key", System.getenv('SIGNING_KEY'))
|
||||
ext["ossrhUsername"] = properties.getProperty("ossrhUsername", System.getenv('OSSRH_USERNAME'))
|
||||
ext["ossrhPassword"] = properties.getProperty("ossrhPassword", System.getenv('OSSRH_PASSWORD'))
|
||||
ext["sonatypeStagingProfileId"] = properties.getProperty("sonatypeStagingProfileId", System.getenv('SONATYPE_STAGING_PROFILE_ID'))
|
||||
ext["snapshot"] = System.getenv('SNAPSHOT') ?: false
|
||||
|
||||
ext {
|
||||
set("GROUP_ID", "org.kiwix")
|
||||
@ -22,6 +23,30 @@ ext {
|
||||
set("VERSION", "2.2.4")
|
||||
}
|
||||
|
||||
if (snapshot) {
|
||||
ext["VERSION_CODE"] = VERSION + "-SNAPSHOT"
|
||||
} else {
|
||||
ext["VERSION_CODE"] = VERSION
|
||||
}
|
||||
|
||||
// Publish to Maven Central
|
||||
nexusPublishing {
|
||||
useStaging.set(provider {
|
||||
def release = publishing.publications.release
|
||||
release.version.endsWith("-SNAPSHOT")
|
||||
})
|
||||
repositories {
|
||||
sonatype {
|
||||
stagingProfileId = properties.getProperty("sonatypeStagingProfileId", System.getenv('SONATYPE_STAGING_PROFILE_ID'))
|
||||
username = properties.getProperty("ossrhUsername", System.getenv('OSSRH_USERNAME'))
|
||||
password = properties.getProperty("ossrhPassword", System.getenv('OSSRH_PASSWORD'))
|
||||
version = VERSION_CODE
|
||||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace these versions with the latest available versions of libkiwix and libzim
|
||||
ext.libkiwix_version = "14.0.0-1"
|
||||
ext.libzim_version = "9.2.3-2"
|
||||
|
@ -5,7 +5,7 @@ def siteUrl = 'https://www.kiwix.org/en/'
|
||||
def gitUrl = 'https://github.com/kiwix/libkiwix.git'
|
||||
|
||||
group = GROUP_ID
|
||||
version = VERSION
|
||||
version = VERSION_CODE
|
||||
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
@ -14,7 +14,7 @@ afterEvaluate {
|
||||
|
||||
groupId GROUP_ID
|
||||
artifactId ARTIFACT_ID
|
||||
version VERSION
|
||||
version VERSION_CODE
|
||||
|
||||
from components.release
|
||||
|
||||
@ -43,15 +43,6 @@ afterEvaluate {
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||
credentials {
|
||||
username = ossrhUsername
|
||||
password = ossrhPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user