Skip to content

Commit

Permalink
deploy to oss.sonatype.org
Browse files Browse the repository at this point in the history
  • Loading branch information
tisoft committed Feb 27, 2021
1 parent 63f0a5b commit 81d97c0
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/maven-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Java CI with Maven - Deploy Release

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Import GPG Owner Trust
run: echo ${{secrets.GPG_OWNERTRUST}} | base64 --decode | gpg --import-ownertrust

- name: Import GPG key
run: echo ${{secrets.GPG_SECRET_KEYS}} | base64 --decode | gpg --import --no-tty --batch --yes
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven
run: mvn --no-transfer-progress -B deploy -Prelease -Drevision=${GITHUB_REF##*/v} -Dchangelist= -Dgpg.keyname=${{secrets.GPG_KEYNAME}} -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

31 changes: 31 additions & 0 deletions .github/workflows/maven-deploy-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Java CI with Maven - Deploy Snapshot

on:
push:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Import GPG Owner Trust
run: echo ${{secrets.GPG_OWNERTRUST}} | base64 --decode | gpg --import-ownertrust

- name: Import GPG key
run: echo ${{secrets.GPG_SECRET_KEYS}} | base64 --decode | gpg --import --no-tty --batch --yes
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven
run: mvn --no-transfer-progress -B deploy -Prelease -Drevision=${GITHUB_REF##*/} -Dgpg.keyname=${{secrets.GPG_KEYNAME}} -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} --file pom.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand All @@ -18,4 +16,4 @@ jobs:
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn --no-transfer-progress -B verify -Drevision=${GITHUB_REF##*/} --file pom.xml
93 changes: 92 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,46 @@
<version>${revision}${sha1}${changelist}</version>

<name>RSyntaxTextArea ANTLR 4 Extension</name>
<description>An ANTLR 4 Extension for RSyntaxTextArea.</description>

<url>https://github.com/tisoft/rsyntaxtextarea-antlr4-extension</url>
<inceptionYear>2021</inceptionYear>

<organization>
<name>Markus Heberling</name>
<url>https://markus.heberling.net</url>
</organization>

<licenses>
<license>
<name>Apache-2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>

<developers>
<developer>
<name>Markus Heberling</name>
<url>https://markus.heberling.net</url>
</developer>
</developers>
<scm>
<connection>scm:git:[email protected]:tisoft/rsyntaxtextarea-antlr4-extension.git</connection>
<developerConnection>scm:git:[email protected]:tisoft/rsyntaxtextarea-antlr4-extension.git</developerConnection>
<tag>HEAD</tag>
<url>scm:git:[email protected]:tisoft/rsyntaxtextarea-antlr4-extension.git</url>
</scm>

<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
<!-- CI friendly versioning-->
<revision>local</revision>
Expand Down Expand Up @@ -217,4 +243,69 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<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.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--batch</arg>
<arg>--yes</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<deployAtEnd>true</deployAtEnd>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 81d97c0

Please sign in to comment.