From 02e96751970a11bdc32fc311f6c04b787e53b63c Mon Sep 17 00:00:00 2001 From: Robert McNees <86265089+robertmcnees@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:30:56 -0400 Subject: [PATCH] Add dependabot configuration (#83) This commit adds dependabot to manage updates of versions. Additionally, the dependency-management plugin now does not specify a version. Also the CI build was chnaged so that a common build file is used. --- .github/dependabot.yml | 32 +++++++++++++++++ .../continuous-integration-build.yml | 30 +--------------- complete/build.gradle | 10 ++++-- initial/build.gradle | 10 ++++-- test/run.sh | 36 ------------------- 5 files changed, 49 insertions(+), 69 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100755 test/run.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e440161 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,32 @@ +version: 2 +updates: + + - package-ecosystem: "maven" + directories: + - "/initial" + - "/complete" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-patch"] + schedule: + interval: "monthly" + target-branch: "main" + groups: + guide-dependencies-maven: + patterns: + - "*" + + - package-ecosystem: "gradle" + directories: + - "/initial" + - "/complete" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-patch"] + schedule: + interval: "monthly" + target-branch: "main" + groups: + guide-dependencies-gradle: + patterns: + - "*" \ No newline at end of file diff --git a/.github/workflows/continuous-integration-build.yml b/.github/workflows/continuous-integration-build.yml index 4dd2265..57061db 100644 --- a/.github/workflows/continuous-integration-build.yml +++ b/.github/workflows/continuous-integration-build.yml @@ -10,32 +10,4 @@ on: jobs: build: - name: Build Main Branch - runs-on: ubuntu-latest - - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - - name: Build Initial with Maven - working-directory: ./initial - run: ./mvnw --batch-mode clean package - - - name: Build Initial with Gradle - working-directory: ./initial - run: ./gradlew build - - - name: Build Complete with Maven - working-directory: ./complete - run: ./mvnw --batch-mode clean package - - - name: Build Complete with Gradle - working-directory: ./complete - run: ./gradlew build + uses: spring-guides/getting-started-macros/.github/workflows/build_initial_complete_maven_gradle.yml@main diff --git a/complete/build.gradle b/complete/build.gradle index 0218dd8..a44b2eb 100644 --- a/complete/build.gradle +++ b/complete/build.gradle @@ -1,12 +1,18 @@ plugins { id 'org.springframework.boot' version '3.3.0' - id 'io.spring.dependency-management' version '1.1.5' id 'java' } +apply plugin: 'io.spring.dependency-management' + group = 'com.example' version = '0.0.1-SNAPSHOT' -sourceCompatibility = '17' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} repositories { mavenCentral() diff --git a/initial/build.gradle b/initial/build.gradle index 0218dd8..a44b2eb 100644 --- a/initial/build.gradle +++ b/initial/build.gradle @@ -1,12 +1,18 @@ plugins { id 'org.springframework.boot' version '3.3.0' - id 'io.spring.dependency-management' version '1.1.5' id 'java' } +apply plugin: 'io.spring.dependency-management' + group = 'com.example' version = '0.0.1-SNAPSHOT' -sourceCompatibility = '17' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} repositories { mavenCentral() diff --git a/test/run.sh b/test/run.sh deleted file mode 100755 index 0374609..0000000 --- a/test/run.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -cd $(dirname $0) - -cd ../complete - -./mvnw clean package -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf target - -./gradlew build -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf build - -cd ../initial - -./mvnw clean compile -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf target - -./gradlew compileJava -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf build - -exit