From 736ea83666f810ebf9e2f0eaf98d93a04e222f89 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Wed, 13 Sep 2023 15:54:44 +0200 Subject: [PATCH] ci: use GitHub Actions --- .github/workflows/check.yml | 27 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++++ .gitignore | 1 + build.gradle | 10 +++++----- 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..9f79c41 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,27 @@ +name: Check + +on: + pull_request: + branches: + - master + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Build and test with Gradle + run: ./gradlew clean check + # https://github.com/marketplace/actions/junit-report-action + - 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/*/*.xml' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..afdaf07 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Build and test with Gradle + env: + ORG_GRADLE_PROJECT_wetfArtifactoryUser: ${{ secrets.WETF_ARTIFACTORY_USER }} + ORG_GRADLE_PROJECT_wetfArtifactoryPassword: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }} + run: ./gradlew clean check publishAllPublicationsToMavenRepository + # https://github.com/marketplace/actions/junit-report-action + - 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/*/*.xml' diff --git a/.gitignore b/.gitignore index aeb07bc..6a021f5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .settings/ .project .classpath +.idea/ diff --git a/build.gradle b/build.gradle index e5dffdf..cb4fd88 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { repositories { - jcenter() + mavenCentral() } dependencies { @@ -40,7 +40,7 @@ configure(srcProjects()) { project -> url 'https://repo.osgeo.org/repository/release/' } - jcenter() + mavenCentral() // haleĀ»studio artifacts maven { @@ -67,7 +67,7 @@ configure(javaProjects()) { // package javadoc into a jar file task packageJavadoc(type: Jar, dependsOn: 'javadoc') { from javadoc.destinationDir - classifier = 'javadoc' + archiveClassifier = 'javadoc' } } @@ -78,7 +78,7 @@ configure(groovyProjects()) { // package groovydoc into a jar file task packageJavadoc(type: Jar, dependsOn: 'groovydoc') { from groovydoc.destinationDir - classifier = 'javadoc' + archiveClassifier = 'javadoc' } } @@ -88,7 +88,7 @@ configure(srcProjects()) { project -> // package source into a jar file task packageSources(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier = 'sources' } // define artifacts for upload