Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
[RFR-405] Update CI workflow and upgrade dependencies (#6)
Browse files Browse the repository at this point in the history
* Update CI workflow (release branch removed, auto-set version)

* Upgrade dependencies
  • Loading branch information
hb0 authored Apr 20, 2023
1 parent 76246c2 commit b5ef560
Show file tree
Hide file tree
Showing 9 changed files with 261 additions and 168 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/build.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow ensures the building step works
#
# @author Armin Schnabel
# @version 1.0.0
# @since 1.0.0
name: Gradle Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'

- name: Build with Gradle
run: ./gradlew build
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
name: Publish to GitHub Packages
# This workflow publishes a new version to the Github Registry.
#
# @author Armin Schnabel
# @version 1.0.0
# @since 1.0.0
name: Gradle Publish

on:
on:
push:
tags:
- '*'
- '[0-9]+.[0-9]+.[0-9]+*'

jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: '11'

# version is required to publish artifacts to Github Registry
- name: Set version
run: |
sed -i "s/version = \"0.0.0\"/version = \"${{ github.ref_name }}\"/g" build.gradle
# Publish slim JARS to Github Package Registry
- name: Publish package
Expand All @@ -22,7 +37,8 @@ jobs:
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

# Automatically mark this tag as release on Github
- uses: actions/create-release@v1
- name: Mark tag as release on Github
uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
Expand Down
14 changes: 9 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= API Library

image:https://img.shields.io/badge/vert.x-4.3.2-purple.svg[link="https://vertx.io"]
image:https://github.com/cyface-de/api/workflows/Cyface%20API/badge.svg[link="https://github.com/cyface-de/api/actions"]
image:https://img.shields.io/badge/vert.x-4.4.0-purple.svg[link="https://vertx.io"]
image:https://github.com/cyface-de/api/actions/workflows/gradle_build.yml/badge.svg[link="https://github.com/cyface-de/api/actions"]

This library is used by the Cyface Vert.X APIs like the https:///github.com/cyface-de/data-collector[Cyface Data Collector] software.

Expand Down Expand Up @@ -47,8 +47,12 @@ Vert.X test classes shared between multiple Cyface Vert.X API projects.

See https://github.com/cyface-de/data-collector#release-a-new-version[Cyface Collector Readme]

* Increment the `version` in the `build.gradle`
* After pushing the release tag to Github the CI automatically builds the artifacts and marks the release on Github
* `version` in root `build.gradle` is automatically set by the CI
* Just tag the release and push the tag to Github
* The Github package is automatically published when a new version is tagged and pushed by our
https://github.com/cyface-de/api/actions[Github Actions] to
the https://github.com/cyface-de/api/packages[Github Registry]
* The tag is automatically marked as a 'new Release' on https://github.com/cyface-de/api/releases[Github]


[#_publishing_artifacts_to_github_packages_manually]
Expand All @@ -70,7 +74,7 @@ This project uses link:https://semver.org/[semantic versioning].

[#_licensing]
== Licensing
Copyright 2018-2022 Cyface GmbH
Copyright 2018-2023 Cyface GmbH

This file is part of the Cyface API Library.

Expand Down
36 changes: 19 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.spotbugs.snom.SpotBugsTask

/*
* Copyright 2020-2022 Cyface GmbH
* Copyright 2020-2023 Cyface GmbH
*
* This file is part of the Cyface API Library.
*
Expand Down Expand Up @@ -35,11 +35,11 @@ plugins {
id 'eclipse'
id 'idea'
//noinspection SpellCheckingInspection
id 'com.github.johnrengelman.shadow' version '6.1.0' apply false
id "com.github.spotbugs" version "4.7.1" apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id "com.github.spotbugs" version "4.7.5" apply false
// Plugin to display the Gradle task graph
//noinspection SpellCheckingInspection
id 'org.barfuin.gradle.taskinfo' version '1.0.5'
id 'org.barfuin.gradle.taskinfo' version '2.1.0'
}

allprojects {
Expand All @@ -58,7 +58,7 @@ subprojects {
apply plugin: 'java-library'

group = 'de.cyface'
version = '2.1.0'
version = "0.0.0" // Automatically overwritten by CI

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand All @@ -78,20 +78,22 @@ subprojects {
}

ext {
vertxVersion = '4.3.2'
slf4jVersion = '1.7.29'
vertxVersion = '4.4.0'
slf4jVersion = '2.0.7'
commonsLangVersion = '3.12.0'
cyfaceSerializationVersion = '2.2.1'
gradleWrapperVersion = '6.8.3'
cyfaceSerializationVersion = '2.3.5'
gradleWrapperVersion = '7.6.1'

// Versions of testing dependencies
junitVersion = '5.7.2'
mockitoVersion = '3.3.3'
junitVersion = '5.9.2'
mockitoVersion = '5.2.0'
hamcrestVersion = '2.2'
flapdoodleVersion = '3.4.5'
flapdoodleVersion = '3.5.3' // major upgrade available

jacocoVersion = '0.8.5'
spotBugsPluginVersion = '1.11.0'
jacocoVersion = '0.8.9'
spotBugsPluginVersion = '1.12.0'
spotbugsToolsVersion = '4.7.3'
pmdToolsVersion = '6.55.0'
}

wrapper {
Expand Down Expand Up @@ -141,7 +143,7 @@ subprojects {
}

spotbugs {
toolVersion = '4.2.3'
toolVersion = "$spotbugsToolsVersion"
ignoreFailures = true
excludeFilter = file("$rootProject.projectDir/config/spotbugs/excludeFilter.xml")
}
Expand All @@ -155,10 +157,10 @@ subprojects {
}

pmd {
toolVersion = '6.22.0'
toolVersion = "$pmdToolsVersion"
incrementalAnalysis = true
ruleSetFiles = project(':').files('config/pmd.xml')
rulePriority = 4
rulesMinimumPriority = 4
ruleSets = []
// There are so many violations and currently it is not really important in this application.
ignoreFailures = true
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b5ef560

Please sign in to comment.