Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
name: Build docker image
on:
workflow_dispatch:
pull_request:
paths:
- Dockerfile
- Makefile
- .github/workflows/docker.yaml
jobs:
build:
strategy:
matrix:
ubuntu-release:
- bionic
- focal
- groovy
name: Build docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: Build image
run: |
docker build -t libsbp-build --build-arg UID=$(id -u) --build-arg UBUNTU_RELEASE=${{ matrix.ubuntu-release }} - <Dockerfile

- name: List images
run: docker images

- name: Run make all inside image
if: matrix.ubuntu-release != 'groovy'
run: |
docker run --rm -v $PWD:/mnt/workspace -t libsbp-build:latest make all
#name: Build docker image
#on:
# workflow_dispatch:
# pull_request:
# paths:
# - Dockerfile
# - Makefile
# - .github/workflows/docker.yaml
#jobs:
# build:
# strategy:
# matrix:
# ubuntu-release:
# - bionic
# - focal
## - jammy
# name: Build docker image
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# submodules: recursive
#
# - name: Build image
# run: |
# docker build -t libsbp-build --build-arg UID=$(id -u) --build-arg UBUNTU_RELEASE=${{ matrix.ubuntu-release }} - <Dockerfile
#
# - name: List images
# run: docker images
#
# - name: Run make all inside image
# run: |
# docker run --rm -v $PWD:/mnt/workspace -t libsbp-build:latest make all
2 changes: 1 addition & 1 deletion .github/workflows/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Installing dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y tox python3-sphinx clang-format-6.0 gradle enchant
sudo apt-get install -y tox python3-sphinx clang-format-6.0 enchant
pip3 install tox-run-command
tox -e py --notest

Expand Down
44 changes: 44 additions & 0 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ libsbp Development Procedures
+ [Error: `!!! No Python wheel (.whl) file found...`](#error--no-python-wheel-whl-file-found)
+ [Tox error: `ERROR: FAIL could not package project`](#tox-error-error-fail-could-not-package-project)
+ [Tox error: `ERROR: cowardly refusing to delete envdir`](#tox-error-error-cowardly-refusing-to-delete-envdir)
- [Distributing Java](#distributing-java)
- [Contributions](#contributions)

<!-- tocstop -->
Expand Down Expand Up @@ -344,6 +345,49 @@ There's an open tox issue for this: https://github.com/tox-dev/tox/issues/1354

pip install --upgrade --force-reinstall tox==3.12.1

# Distributing Java

To distribute java, ensure you have the correct credentials and prerequisites
- Gradle 7+
- gradle.properties
- Sonatype deployer account
- Your own GPG key


Add in gradle.properties located in `.gradle` or wherever the working directory is setup
(probably located/have to create it in `/User/<user>/.gradle/gradle.properties`)

```shell
# last 8 digit of gpg key
signing.keyId=xxx
# password for gpg key
signing.password=xxx
# path to exported secret gpg keys
signing.secretKeyRingFile=path_to_secret.gpg

# sonatype logins
ossrhUsername=xxx
ossrhPassword=xxx
```

Modify `ossrhUsername` and `ossrhPassword` with the sonatype deployer account
(or an individual one with deployer role)


Generate GPG key with
```shell
gpg --gen-key
gpg --export-secret-keys <key> > keys.gpg
gpg --keyserver keyserver.ubuntu.com --send-keys <key>
```

To publish, run gradle publish - (might have some conflicts with the version, so should use Makefile to actually
publish with version, make dist-java in docker)

After publishing, go to Nexus Repository Manager. Select the deployed version, close the staging repository
and release to finish it off.


# Contributions

This library is developed internally by Swift Navigation. We welcome
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,12 @@ dist-rust:
git reset --hard $(SBP_VERSION)
$(call announce-end,"Finished reverting commit made by `sbp2json` deployment")

dist: dist-python dist-javascript dist-haskell dist-rust
dist-java:
$(call announce-begin,"Deploying Java to maven central")
VERSION=$(SBP_VERSION_UNPREFIXED) gradle publish
$(call announce-end,"Finished deploying Java to maven central")

dist: dist-python dist-javascript dist-haskell dist-rust dist-java

pdf:
$(call announce-begin,"Generating PDF datasheet documentation")
Expand Down
67 changes: 67 additions & 0 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id "org.sonarqube" version "3.3"
// spotless pre v5 used to allow gradle 4 on ubuntu-latest
id "com.diffplug.gradle.spotless" version "4.5.1"
id 'maven-publish'
id 'signing'
}

apply plugin: 'java'
Expand Down Expand Up @@ -84,3 +86,68 @@ spotless {
' */\n'
}
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {

mavenJava(MavenPublication) {

groupId = 'com.swiftnav'
artifactId = 'sbp'
version = System.getenv("VERSION") ?: "unset-version-build" // should instead fail if version not provided?
from components.java

pom {
name = 'libsbp'
description = 'Swift binary protocol client libraries'
url = 'https://github.com/swift-nav/libsbp'
inceptionYear = '2021'

licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'adrian-kong'
name = 'Adrian Kong'
email = 'adrian.kong@swift-nav.com'
}
}
scm {
connection = 'scm:git:git:github.com/swift-nav/libsbp.git'
developerConnection = 'scm:git:ssh://github.com/swift-nav/libsbp.git'
url = 'https://github.com/swift-nav/libsbp'
}
}
}
}

repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.properties["ossrhUsername"]
password = project.properties["ossrhPassword"]
}
}
}
}

signing {
sign publishing.publications.mavenJava
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}