Skip to content

Commit

Permalink
Merge pull request #4 from joshmoore/maven-central
Browse files Browse the repository at this point in the history
Configure Maven Central deployment
  • Loading branch information
joshmoore authored Jul 4, 2024
2 parents 98c25d5 + f369718 commit d5f6af5
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- name: Set up Java 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Install Blosc native library
run: sudo apt-get install -y libblosc1

- id: install-secret-key
name: Install gpg secret key
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- name: Publish package
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
81 changes: 79 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,42 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>dev.zarr.zarrjava</groupId>
<groupId>dev.zarr</groupId>
<artifactId>zarr-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>

<name>zarr-java</name>

<description>
zarr-java is a Java library providing an implementation of chunked,
compressed, N-dimensional arrays close to the zarr-python package.
</description>

<url>https://github.com/zarr-developers/zarr-java</url>

<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit/</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/zarr-developers/zarr-java</url>
<connection>scm:git:git://github.com/zarr-developers/zarr-java.git</connection>
<developerConnection>scm:git:[email protected]:zarr-developers/zarr-java.git</developerConnection>
</scm>

<developers>
<developer>
<id>normanrz</id>
<name>Norman Rzepka</name>
<roles>
<role>maintainer</role>
</roles>
</developer>
</developers>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down Expand Up @@ -85,6 +118,17 @@
</dependency>
</dependencies>

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

<repositories>
<repository>
<id>unidata-all</id>
Expand All @@ -103,6 +147,39 @@
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
</configuration>
</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>
<configuration>
<keyname>9F88D86AD9A0D91E</keyname>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit d5f6af5

Please sign in to comment.