Skip to content

Commit

Permalink
Merge pull request #265 from RADAR-base/release-0.7.1
Browse files Browse the repository at this point in the history
Release 0.7.1
  • Loading branch information
blootsvoets authored Jun 29, 2021
2 parents 20acf3a + 10fcf3e commit 83ffd17
Show file tree
Hide file tree
Showing 13 changed files with 568 additions and 65 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', 'java-sdk/**/*.gradle.kts', 'java-sdk/gradle.properties', 'java-sdk/*/src/main/**', 'commons/**', 'specifications/**', 'docker/**') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
Expand All @@ -90,11 +82,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
id: cache-buildx
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', 'java-sdk/**/*.gradle', 'java-sdk/gradle.properties', 'java-sdk/*/src/main/**', 'commons/**', 'specifications/**', 'docker/**') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Cache parameters
id: cache-parameters
run: |
if [ "${{ steps.cache-buildx.outputs.cache-hit }}" = "true" ]; then
echo "::set-output name=cache-to::"
else
echo "::set-output name=cache-to::type=local,dest=/tmp/.buildx-cache-new,mode=max"
fi
- name: Build docker
uses: docker/build-push-action@v2
with:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
load: true
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
Expand All @@ -106,7 +116,7 @@ jobs:
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
- name: Inspect docker images
- name: Inspect docker image
run: docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}

- name: Check docker image
Expand All @@ -115,6 +125,15 @@ jobs:
docker run --rm ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} radar-schemas-tools --help
# Push the image on the dev and master branches
- name: Push images
- name: Push image
if: ${{ github.event_name != 'pull_request' }}
run: docker push ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move docker build cache
if: steps.cache-buildx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
53 changes: 53 additions & 0 deletions .github/workflows/publish_snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Continuous integration, including test and integration test
name: Publish snapshots

# Run in master and dev branches and in all pull requests to those branches
on:
push:
branches: [ dev ]

jobs:
# Build and test the code
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

defaults:
run:
working-directory: java-sdk

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Has SNAPSHOT version
id: is-snapshot
run: grep "version = '.*-SNAPSHOT'" build.gradle

- uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache
uses: actions/cache@v2
with:
# Cache gradle directories
path: |
~/.gradle/caches
~/.gradle/wrapper
# Key for restoring and saving the cache
key: ${{ runner.os }}-java-${{ hashFiles('**/*.gradle', 'java-sdk/gradle.properties') }}
restore-keys: |
${{ runner.os }}-java-
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew -Psigning.gnupg.keyName=CBEF2CF0 -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} publish
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
release:
types: [published]

env:
DOCKER_IMAGE: radarbase/radar-schemas-tools

jobs:
upload:
# The type of runner that the job will run on
Expand Down Expand Up @@ -64,6 +61,9 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
DOCKER_IMAGE: radarbase/radar-schemas-tools

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
- name: Build docker
uses: docker/build-push-action@v2
with:
# Allow running the image on the architectures supported by openjdk:11-jre-slim
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ RUN mkdir -p /code/java-sdk
WORKDIR /code/java-sdk
ENV GRADLE_USER_HOME=/code/.gradlecache

COPY java-sdk/gradle/*.gradle /code/java-sdk/gradle/
COPY java-sdk/build.gradle java-sdk/settings.gradle /code/java-sdk/
COPY java-sdk/radar-schemas-commons/build.gradle /code/java-sdk/radar-schemas-commons/
COPY java-sdk/radar-schemas-core/build.gradle /code/java-sdk/radar-schemas-core/
COPY java-sdk/radar-schemas-registration/build.gradle /code/java-sdk/radar-schemas-registration/
COPY java-sdk/radar-schemas-tools/build.gradle /code/java-sdk/radar-schemas-tools/
COPY java-sdk/radar-catalog-server/build.gradle /code/java-sdk/radar-catalog-server/
RUN gradle downloadDependencies --no-watch-fs
RUN gradle downloadDependencies --no-watch-fs -Pprofile=docker

COPY commons /code/commons
COPY specifications /code/specifications
Expand All @@ -22,7 +21,7 @@ COPY java-sdk/radar-schemas-registration/src /code/java-sdk/radar-schemas-regist
COPY java-sdk/radar-schemas-tools/src /code/java-sdk/radar-schemas-tools/src
COPY java-sdk/radar-catalog-server/src /code/java-sdk/radar-catalog-server/src

RUN gradle distTar --no-watch-fs \
RUN gradle distTar --no-watch-fs -Pprofile=docker \
&& cd radar-schemas-tools/build/distributions \
&& tar xzf radar-schemas-tools*.tar.gz \
&& cd ../../../radar-catalog-server/build/distributions \
Expand Down
4 changes: 2 additions & 2 deletions commons/push/garmin/garmin_pulse_ox.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{"name": "startTimeOffset", "type": ["null", "int"], "doc": "Offset in seconds to add to time to derive the 'local' time of the device that captured the data.", "default": null},
{"name": "date", "type": ["null", "string"], "doc": "The calendar date this summary would be displayed on in Garmin Connect in the local time zone of the device. The date format is ‘yyyy-mm-dd’.", "default": null},
{"name": "duration", "type": ["null", "int"], "doc": "Length of the monitoring period in seconds. 86400 once a full day is complete, but less if a user syncs mid-day.", "default": null},
{"name": "spo2", "type": ["null", "float"], "doc": "The SpO2 measurement taken at the time (1 sample/minute).", "default": null},
{"name": "spo2Value", "type": ["null", "float"], "doc": "The SpO2 measurement taken at the time (1 sample/minute).", "default": null},
{"name": "onDemand", "type": ["null", "boolean"], "doc": "A Boolean to show whether this pulse ox summary represents an on- demand reading or an averaged acclimation reading.", "default": null}
]
}
}
12 changes: 3 additions & 9 deletions java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

allprojects {
version = '0.7.0'
version = '0.7.1'
group = 'org.radarbase'
}

Expand Down Expand Up @@ -57,14 +57,8 @@ subprojects {
task downloadDependencies {
description "Pre-downloads *most* dependencies"
doLast {
configurations.getAsMap().each { name, config ->
println "Retrieving dependencies for $name"
try {
config.files
} catch (e) {
project.logger.info e.message // some cannot be resolved, silentlyish skip them
}
}
configurations.compileClasspath.files
configurations.runtimeClasspath.files
}
}
}
Expand Down
14 changes: 3 additions & 11 deletions java-sdk/radar-catalog-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
plugins {
id 'idea'
id 'checkstyle'
id 'pmd'
id 'application'
}

Expand All @@ -19,13 +16,6 @@ configurations {
}
}

sourceSets {
application {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}

description = 'RADAR Schemas specification and validation tools.'

dependencies {
Expand All @@ -47,7 +37,9 @@ application {
mainClass.set('org.radarbase.schema.service.SourceCatalogueServer')
}

apply from: "$rootDir/gradle/testing.gradle"
if (!project.hasProperty("profile") || project.property("profile") != "docker") {
apply from: "$rootDir/gradle/testing.gradle"
}

//---------------------------------------------------------------------------//
// Publishing //
Expand Down
4 changes: 3 additions & 1 deletion java-sdk/radar-schemas-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ compileJava.dependsOn generateAvro
// Publishing //
//---------------------------------------------------------------------------//

apply from: "$rootDir/gradle/publishing.gradle"
if (!project.hasProperty("profile") || project.property("profile") != "docker") {
apply from: "$rootDir/gradle/publishing.gradle"
}
9 changes: 4 additions & 5 deletions java-sdk/radar-schemas-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id 'java-library'
id 'idea'
id 'checkstyle'
id 'pmd'
}

compileJava {
Expand Down Expand Up @@ -53,5 +50,7 @@ dependencies {
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
}

apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/testing.gradle"
if (!project.hasProperty("profile") || project.property("profile") != "docker") {
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/testing.gradle"
}
16 changes: 4 additions & 12 deletions java-sdk/radar-schemas-registration/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id 'java-library'
id 'idea'
id 'checkstyle'
id 'pmd'
}

compileJava {
Expand All @@ -19,13 +16,6 @@ configurations {
}
}

sourceSets {
application {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}

description = 'RADAR Schemas specification and validation tools.'

repositories {
Expand Down Expand Up @@ -57,5 +47,7 @@ tasks.withType(Tar) {
archiveExtension.set('tar.gz')
}

apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/testing.gradle"
if (!project.hasProperty("profile") || project.property("profile") != "docker") {
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/testing.gradle"
}
8 changes: 0 additions & 8 deletions java-sdk/radar-schemas-tools/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id 'idea'
id 'application'
}

Expand All @@ -17,13 +16,6 @@ configurations {
}
}

sourceSets {
application {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}

description = 'RADAR Schemas specification and validation tools.'

repositories {
Expand Down
Loading

0 comments on commit 83ffd17

Please sign in to comment.