Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add jreleaser and workflow cleanup #127

Merged
merged 15 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Set up JDK 1.8
uses: actions/setup-java@v1

- uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'temurin'
java-version: '8'
cache: 'gradle'

- name: Set Version
id: set-version
run: "./gradlew properties -q | grep version: | awk '{print \"::set-output name=version::\" $2}'"
run: echo "version=$(./gradlew mule-linter-core:properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_OUTPUT

- name: Print Version
run: echo "Version ${{ steps.set-version.outputs.version }}"
Expand All @@ -37,44 +40,41 @@ jobs:
- name: Verify
run: ./gradlew check

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: ./**/build/test-results/test/*.xml
files: |
**/build/test-results/**/*.xml

# - name: Maven Deploy and Release
# if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
# env:
# JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
# JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
# JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
# JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
# JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# JRELEASER_NEXUS2_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# run: ./gradlew publish jreleaserFullRelease
- name: Stage Deployment
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
run: ./gradlew publish

- name: Maven Deploy and Release
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
- name: JReleaser full-Release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
uses: jreleaser/release-action@v2
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
JRELEASER_PROJECT_VERSION: ${{steps.set-version.outputs.version}}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
JRELEASER_VERSION: 1.6.0
with:
version: ${{ env.JRELEASER_VERSION }}
arguments: full-release

- name: Tag Release
if: ${{ !contains(steps.set-version.outputs.version, 'SNAPSHOT') && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
env:
GIT_USER: ${{ secrets.GIT_USER }}
GIT_PASSWORD: ${{ secrets.GIT_TOKEN }}
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git remote set-url origin "https://${{github.actor}}:${{ github.token }}@github.com/${{ github.repository }}.git"
git tag -a "v${{ steps.set-version.outputs.version }}" "${{ github.sha }}" -m "Version ${{ steps.set-version.outputs.version }}"
git push origin "v${{ steps.set-version.outputs.version }}"
- name: JReleaser release output
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties

- name: Increment Version
if: ${{ !contains(steps.set-version.outputs.version, 'SNAPSHOT') && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Set New Version Variable
if: ${{ !contains(steps.set-version.outputs.version, 'SNAPSHOT') && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
id: set-new-version
run: "./gradlew properties -q | grep version: | awk '{print \"::set-output name=version::\" $2}'"
run: echo "version=$(./gradlew mule-linter-core:properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_OUTPUT

- name: Create Pull Request
if: ${{ !contains(steps.set-version.outputs.version, 'SNAPSHOT') && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
Expand Down
134 changes: 0 additions & 134 deletions build.gradle

This file was deleted.

14 changes: 14 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
id 'groovy-gradle-plugin'
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation 'de.benediktritter.maven-plugin-development:de.benediktritter.maven-plugin-development.gradle.plugin:0.4.2'
implementation 'net.thauvin.erik.gradle.semver:net.thauvin.erik.gradle.semver.gradle.plugin:1.0.4'
testImplementation platform("org.spockframework:spock-bom:2.2-groovy-3.0")
testImplementation 'org.spockframework:spock-core'
}
5 changes: 5 additions & 0 deletions buildSrc/src/main/groovy/mule-linter.app-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id 'mule-linter.groovy-common-conventions'
id 'mule-linter.maven-publish-conventions'
id 'application'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
plugins {
id 'groovy'
id 'codenarc'
id 'mule-linter.semver'
}

group 'com.avioconsulting.mule'

repositories {
mavenCentral()
}

dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.17'
testImplementation platform('org.spockframework:spock-bom:2.3-groovy-3.0')
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
}

test {
useJUnitPlatform()
}

compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked"
}

compileTestJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked"
}

tasks.register('groovydocJar', Jar) {
dependsOn groovydoc
archiveClassifier = 'javadoc'
from groovydoc.destinationDir
}

jar.dependsOn(groovydocJar)

codenarc {
configFile = file("${rootProject.projectDir}/config/code-quality-config/codenarc/codenarc.xml")
ignoreFailures = true
}

4 changes: 4 additions & 0 deletions buildSrc/src/main/groovy/mule-linter.lib-conventions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id 'mule-linter.groovy-common-conventions'
id 'mule-linter.maven-publish-conventions'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id 'mule-linter.groovy-common-conventions'
id 'mule-linter.maven-publish-conventions'
id 'de.benediktritter.maven-plugin-development'
}

dependencies {
implementation 'org.apache.maven.plugins:maven-plugin-plugin:3.6.4'
compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.4'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
id 'maven-publish'
}

publishing {
publications {
maven(MavenPublication) {
from components.java
artifact groovydocJar
pom {
name = project.name
description = project.name
url = 'https://github.com/avioconsulting/mule-linter'
inceptionYear = '2020'
licenses {
license {
name = 'MIT'
url = 'https://spdx.org/licenses/MIT.html'
}
}
developers {
developer {
id = 'adesjardin'
name = 'Adam Desjardin'
}
developer {
id = 'kkingavio'
name = 'Kevin King'
}
developer {
id = 'manikmagar'
name = 'Manik Magar'
}
developer {
id = 'MrMcCartney'
name = 'Reed McCartney'
}
developer {
id = 'vanessacobis'
name = 'Vanessa Cobis'
}
scm {
connection = 'scm:git:https://github.com/avioconsulting/mule-linter.git'
developerConnection = 'scm:git:ssh://github.com/avioconsulting/mule-linter.git'
url = 'https://github.com/avioconsulting/mule-linter'
}
}
}
}
}
repositories {
maven {
name = 'staging'
url = layout.buildDirectory.dir("staging-deploy")
}
}
}
Loading