diff --git a/.github/workflows/github-build.yml b/.github/workflows/github-build.yml index 38ba13b..658243a 100644 --- a/.github/workflows/github-build.yml +++ b/.github/workflows/github-build.yml @@ -1,25 +1,41 @@ -name: Java CI +name: Build -on: [push] +on: + push: + branches: + - 'master' + pull_request: jobs: build: + name: Build & Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v2 + - name: Clone repository + uses: actions/checkout@v3 with: - java-version: '8' + fetch-depth: 0 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' distribution: 'temurin' - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b + uses: gradle/wrapper-validation-action@v1 + - name : Retrieve module version from Reckon + run: echo "VERSION_NAME=$(${{github.workspace}}/gradlew -q clfPrintVersion)" >> $GITHUB_OUTPUT + id: retrieve_version + - name: Publish module version to Github Step Summary + run: | + echo "# ${{steps.retrieve_version.outputs.VERSION_NAME}}" >> $GITHUB_STEP_SUMMARY - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 + uses: gradle/gradle-build-action@v2 with: arguments: build - - name: Upload coverage reports - uses: codecov/codecov-action@v2 + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails with: - files: build/reports/kover/report.xml + report_paths: '**/build/test-results/test/TEST-*.xml' + include_passed: true \ No newline at end of file diff --git a/.github/workflows/github-publish.yml b/.github/workflows/github-publish.yml index f71894f..5a82752 100644 --- a/.github/workflows/github-publish.yml +++ b/.github/workflows/github-publish.yml @@ -1,27 +1,57 @@ -name: Publish package to the Maven Central Repository +name: Publish to Maven Central on: - release: - types: [created] + workflow_dispatch: + inputs: + stage: + description: 'the stage of the version' + required: true + default: 'rc' + type: choice + options: + - rc + - final jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Clone repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'temurin' - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b - - name: Publish package - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 + uses: gradle/wrapper-validation-action@v1 + - name : Retrieve module version from Reckon + run: echo "VERSION_NAME=$(${{github.workspace}}/gradlew -q clfPrintVersion -Preckon.stage=${{ inputs.stage }})" >> $GITHUB_OUTPUT + id: retrieve_version + - name: Publish module version to Github Step Summary + run: | + echo "# ${{steps.retrieve_version.outputs.VERSION_NAME}}" >> $GITHUB_STEP_SUMMARY + - name: Publish and Create Tag + uses: gradle/gradle-build-action@v2 with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository + arguments: check reckonTagPush publishToSonatype closeAndReleaseSonatypeStagingRepository -Preckon.stage=${{ inputs.stage }} env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} PGP_SECRET: ${{ secrets.PGP_SECRET }} - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} \ No newline at end of file + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + include_passed: true + - name: Create Release on GitHub + uses: softprops/action-gh-release@v1 + with: + name: ${{steps.retrieve_version.outputs.VERSION_NAME}} + tag_name: ${{steps.retrieve_version.outputs.VERSION_NAME}} + generate_release_notes: true + append_body: true \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 824f9b0..0078931 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ plugins { - id("io.cloudflight.autoconfigure-gradle") version "0.5.3" `maven-publish` id("io.github.gradle-nexus.publish-plugin") version "1.1.0" signing @@ -7,11 +6,10 @@ plugins { description = "Spring Boot AutoConfigure Support for the Structurizr Client" group = "io.cloudflight.structurizr" -version = "1.0.1" autoConfigure { java { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) vendorName.set("Cloudflight") } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..41d9927 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..0d18421 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-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index d8d84b4..e49819c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,9 @@ +plugins { + id("io.cloudflight.autoconfigure-settings") version "1.1.1" +} rootProject.name = "structurizr-autoconfigure" +configure { + setScopeCalc(calcScopeFromCommitMessages()) +} \ No newline at end of file