From 6ebd7b6424aeabde3c7e28d1257b0db65b6865ef Mon Sep 17 00:00:00 2001 From: Armin Date: Thu, 20 Apr 2023 11:42:45 +0200 Subject: [PATCH] [RFR-405] Update CI workflow and upgrade dependencies (#30) * Update CI workflow (no release branch, auto-tag version) * Upgrade dependencies * Fix typo --- .github/workflows/build.yml | 26 -------------- .github/workflows/gradle_build.yml | 34 +++++++++++++++++++ .../{publish-jar.yml => gradle_publish.yml} | 31 +++++++++++++---- README.adoc | 4 +-- VERSION | 2 +- build.gradle | 12 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 68 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/gradle_build.yml rename .github/workflows/{publish-jar.yml => gradle_publish.yml} (51%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0f3d53c..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Standard CI - -on: - push: - branches: - - main - - release - pull_request: - branches: - - main - - release - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Build with Gradle - run: ./gradlew build - env: - USERNAME: ${{ github.actor }} - PASSWORD: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gradle_build.yml b/.github/workflows/gradle_build.yml new file mode 100644 index 0000000..32e0b78 --- /dev/null +++ b/.github/workflows/gradle_build.yml @@ -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 }} diff --git a/.github/workflows/publish-jar.yml b/.github/workflows/gradle_publish.yml similarity index 51% rename from .github/workflows/publish-jar.yml rename to .github/workflows/gradle_publish.yml index 1f530a5..bb2184d 100644 --- a/.github/workflows/publish-jar.yml +++ b/.github/workflows/gradle_publish.yml @@ -1,18 +1,34 @@ -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: 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/0.0.0/${{ github.ref_name }}/g" VERSION + sed -i "s/pod 'Protos', '~> 0.0.0'/pod 'Protos', '~> ${{ github.ref_name }}'/g" README.adoc # Publish slim JARS to Github Package Registry - name: Publish package @@ -22,7 +38,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 }} diff --git a/README.adoc b/README.adoc index 313042c..7d0bfa5 100644 --- a/README.adoc +++ b/README.adoc @@ -72,7 +72,7 @@ Swift classes may be generated using link:https://github.com/apple/swift-protobu You can include the `.proto` file with your Swift project from the Cyface custom Pod repository: `https://github.com/cyface-de/ios-podspecs.git` using CocoaPods: ``` -pod 'Protos', '~> 2.1.0' +pod 'Protos', '~> 0.0.0' ``` Using a custom Pods repository is explained on the link:https://guides.cocoapods.org/making/private-cocoapods.html[CocoaPods Website]. @@ -88,7 +88,7 @@ link:https://developers.google.com/protocol-buffers/docs/javatutorial#builders[S [#_licensing] == Licensing -Copyright 2021-2022 Cyface GmbH +Copyright 2021-2023 Cyface GmbH This file is part of the Cyface Protobuf Messages. diff --git a/VERSION b/VERSION index 7ec1d6d..77d6f4c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 +0.0.0 diff --git a/build.gradle b/build.gradle index b411461..20bcb10 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 Cyface GmbH + * Copyright 2021-2023 Cyface GmbH * * This file is part of the Cyface Protobuf Messages. * @@ -20,7 +20,7 @@ * The root build gradle file. * * @author Armin Schnabel - * @version 1.0.1 + * @version 1.0.2 * @since 1.0.0 */ buildscript { @@ -36,7 +36,7 @@ plugins { id 'maven-publish' //noinspection SpellCheckingInspection id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'com.google.protobuf' version '0.8.18' + id 'com.google.protobuf' version '0.9.2' } group = 'de.cyface' @@ -52,11 +52,11 @@ tasks.withType(JavaCompile) { ext { commonsLangVersion = '3.12.0' gradleWrapperVersion = '7.4.2' - protobufVersion = '3.21.1' + protobufVersion = '3.22.2' // Versions of testing dependencies - junitVersion = '5.8.2' - mockitoVersion = '4.6.0' + junitVersion = '5.9.2' + mockitoVersion = '5.2.0' hamcrestVersion = '2.2' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..774fae8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists