Skip to content

Commit

Permalink
Deploy to csdms (#12)
Browse files Browse the repository at this point in the history
* Rename to build

* Don't run javadoc on build

* Tell Maven where to deploy the package

* Set up deploy action

* Remove javadoc plugin

* Lock plugin versions and create checksums on install

* Use wagon extension to deploy with scp to CSDMS repository

* Remove deploy action

* Include deploy instructions

* Update status badge
  • Loading branch information
mdpiper authored Dec 3, 2021
1 parent db0c9a7 commit a0b18eb
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 25 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/maven.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Maven CI
name: Build CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
build:
name: Check source and build jar
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -16,9 +16,7 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'
- name: Check style
run: mvn --batch-mode --update-snapshots checkstyle:check
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
- name: Run Javadoc with Maven
run: mvn --batch-mode --update-snapshots javadoc:javadoc
- name: Check style with Maven
run: mvn --batch-mode --update-snapshots checkstyle:check
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Maven CI](https://github.com/csdms/bmi-java/actions/workflows/maven.yml/badge.svg)](https://github.com/csdms/bmi-java/actions/workflows/maven.yml)
[![Build CI](https://github.com/csdms/bmi-java/actions/workflows/build.yml/badge.svg)](https://github.com/csdms/bmi-java/actions/workflows/build.yml)

# bmi-java

Expand Down Expand Up @@ -49,10 +49,44 @@ target
`-- inputFiles.lst
```

To install the jar file to your local Maven repository for use with other packages, run
To install the jar file to your local Maven repository
(typically `~/.m2/repository`)
for use with other packages, run

$ mvn install

The result in the local repository will look like
```bash
edu
`-- colorado
`-- csdms
`-- bmi
|-- 2.0
| |-- _remote.repositories
| |-- bmi-2.0.jar
| |-- bmi-2.0.jar.md5
| |-- bmi-2.0.jar.sha1
| |-- bmi-2.0.pom
| |-- bmi-2.0.pom.md5
| `-- bmi-2.0.pom.sha1
|-- maven-metadata-local.xml
|-- maven-metadata-local.xml.md5
`-- maven-metadata-local.xml.sha1
4 directories, 10 files
```

### Developer note: Deploy

The `bmi` package is hosted on the [CSDMS Apache Maven Repository](https://csdms.colorado.edu/repository).
To deploy the `bmi` package to this site, run
```
$ mvn deploy
```
on a machine where you have provided [server settings and encrypted login credentials](http://maven.apache.org/guides/mini/guide-encryption.html#how-to-encrypt-server-passwords)
for the site in your local `settings.xml` file.
## Use
To write a BMI for a model,
Expand Down
40 changes: 27 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<description>Basic Model Interface for Java</description>

Expand Down Expand Up @@ -58,18 +59,6 @@
<build>
<finalName>bmi</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<source>8</source>
<links>
<link>https://github.com/csdms/bmi-java</link>
</links>
<detectLinks>true</detectLinks>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
Expand All @@ -78,6 +67,17 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand All @@ -95,6 +95,20 @@
</dependencies>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>3.0.0</version>
</extension>
</extensions>
</build>
<modelVersion>4.0.0</modelVersion>

<distributionManagement>
<repository>
<id>csdms</id>
<name>CSDMS Apache Maven Packages</name>
<url>scpexe://arroyo.colorado.edu/data/web/html/csdms.colorado.edu/repository</url>
</repository>
</distributionManagement>
</project>

0 comments on commit a0b18eb

Please sign in to comment.