Skip to content

Commit 3b8962e

Browse files
authored
Mage 1603 (#83)
[mage-1603] Github Actions workflow and gradle config updates
1 parent 6e679ab commit 3b8962e

File tree

4 files changed

+22
-51
lines changed

4 files changed

+22
-51
lines changed

.github/workflows/publish-to-staging.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: Publish to Maven Central (Staged)
2-
1+
name: Publish and close to staging repo
2+
#Uploads to a new staging repository and closes it, making it available for viewing on the Maven portal
3+
#The repo will then need to be manually released on the portal before it is available on Maven Central
34
on:
45
release:
56
types: [published]
@@ -23,13 +24,13 @@ jobs:
2324
- name: Grant execute permission for gradlew
2425
run: chmod +x gradlew
2526

26-
- name: Publish to Sonatype Staging Repository
27+
- name: Publish and Close Sonatype Staging Repository
2728
env:
2829
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2930
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
3031
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3132
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
3233
run: |
33-
# Use --no-scan to prevent sending build data to Gradle's servers
34-
# The publishToSonatype task uploads to the staging repo, but does not close it
35-
./gradlew publishToSonatype --no-scan
34+
# publishToSonatype: Uploads artifacts to a new staging repository.
35+
# closeSonatypeRepository: Closes the staging repository, running validations and making it visible in the portal.
36+
./gradlew publishToSonatype closeSonatypeStagingRepository --no-scan

.github/workflows/release-from-staging.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

build.gradle

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ buildscript {
1414

1515
plugins {
1616
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
17-
id 'signing'
1817
}
1918

2019
allprojects {
20+
group = "mil.nga.geopackage"
21+
version = "6.7.5"
22+
2123
repositories {
2224
google()
2325
mavenCentral()
@@ -36,11 +38,17 @@ nexusPublishing {
3638
}
3739
}
3840

39-
signing {
40-
def signingKey = System.getenv("GPG_PRIVATE_KEY")
41-
def signingPassword = System.getenv("GPG_PASSWORD")
41+
subprojects {
42+
apply plugin: 'signing' //apply signing plugin to all subprojects
4243

43-
if (signingKey != null && signingPassword != null) {
44-
useInMemoryPgpKeys(signingKey, signingPassword)
44+
afterEvaluate {
45+
def signingKey = System.getenv("GPG_PRIVATE_KEY")
46+
def signingPassword = System.getenv("GPG_PASSWORD")
47+
if (signingKey != null && signingPassword != null) {
48+
signing {
49+
useInMemoryPgpKeys(signingKey, signingPassword)
50+
sign publishing.publications
51+
}
52+
}
4553
}
4654
}

geopackage-sdk/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ plugins {
44
id "maven-publish"
55
}
66

7-
group = "mil.nga.geopackage"
87
archivesBaseName = "geopackage-android"
9-
version = "6.7.5"
108

119
android {
1210
namespace 'mil.nga.geopackage'
@@ -107,7 +105,7 @@ afterEvaluate {
107105

108106
groupId = group
109107
artifactId = archivesBaseName
110-
version = version
108+
111109
pom {
112110
name = 'GeoPackage Android'
113111
packaging = 'aar'

0 commit comments

Comments
 (0)