Skip to content

Commit

Permalink
Publishes orchid-maven-plugin to MavenCentral
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbrooks12 committed Aug 8, 2021
1 parent 6e5ebd2 commit a968057
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
4 changes: 3 additions & 1 deletion buildSrc/orchidMavenPlugin/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e

./mvnw versions:set -DnewVersion=$GRADLE_PROJECT_RELEASE_NAME
export GPG_TTY=$(tty)

./mvnw versions:set -DnewVersion=$projectVersion
./mvnw deploy -s settings.xml
89 changes: 85 additions & 4 deletions buildSrc/orchidMavenPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@

<modelVersion>4.0.0</modelVersion>

<groupId>io.github.javaeden.orchid</groupId>
<groupId>io.github.copper-leaf.orchid</groupId>
<artifactId>orchid-maven-plugin</artifactId>
<version>0.18.0</version>
<version>1.0.0</version>

<name>Orchid Maven plugin</name>
<description>A Maven plugin for building and running Orchid sites.</description>
<url>https://orchid.run</url>
<licenses>
<license>
<name>GPL-2.0</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
</license>
</licenses>
<developers>
<developer>
<id>cjbrooks12</id>
<name>Casey Brooks</name>
<email>cjbrooks12@gmail.com</email>
</developer>
</developers>
<scm>
<url>https://github.com/orchidhq/orchid.git</url>
</scm>

<packaging>maven-plugin</packaging>

<properties>
Expand Down Expand Up @@ -50,13 +69,75 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>orchid-bintray</id>
<url>https://api.bintray.com/maven/javaeden/Orchid/${project.artifactId}/;publish=1;override=1</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
20 changes: 16 additions & 4 deletions buildSrc/orchidMavenPlugin/settings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<servers>
<server>
<id>orchid-bintray</id>
<username>${env.ORG_GRADLE_PROJECT_bintray_username}</username>
<password>${env.ORG_GRADLE_PROJECT_bintray_apiKey}</password>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>
</settings>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.keyname>${env.SIGNING_KEY_ID}</gpg.keyname>
<gpg.passphrase>${env.SIGNING_PASSWORD}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/copper-leaf-sonatype.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,18 @@ val closeSonatypeStagingRepository by tasks.registering {
publishConfiguration.stagingRepositoryIdFile.delete()
}
}

val writeProjectVersion by tasks.registering {
description = "Write the project version to a file"
doLast {
val file = project.rootProject.buildDir.resolve("export").resolve("projectVersion")
if(!file.parentFile.exists()) {
file.parentFile.mkdirs()
}
if(!file.exists()) {
file.createNewFile()
}

file.writeText(Config.projectVersion(project).toString())
}
}
4 changes: 3 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash
set -e

./gradlew writeProjectVersion -Prelease
export projectVersion=`cat ./build/export/projectVersion`

# Build and deploy normal Gradle projects
./gradlew assemble publishToMavenLocal publish :docs:orchidDeploy -PorchidEnvironment=prod -Prelease
export GRADLE_PROJECT_RELEASE_NAME=$(./gradlew getReleaseName -Prelease --quiet)

# Deploy Gradle plugin
pushd buildSrc
Expand Down

0 comments on commit a968057

Please sign in to comment.