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

Action #22

Merged
merged 3 commits into from
Sep 11, 2024
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
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ jobs:
java-version: '21'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build
run: |
./gradlew build
- uses: actions/upload-artifact@v4
with:
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/build_jar.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/gradle.yml

This file was deleted.

15 changes: 8 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ jobs:
java-version: '21'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Add release flag if input variable is set
if: ${{ inputs.release }}
shell: bash
run: |
echo "RELEASE_FLAG='-P release=true'" >> $GITHUB_ENV
echo "RELEASE_FLAG='-Prelease'" >> $GITHUB_ENV

- name: Publish snapshot
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publish -P toolchain=21 $RELEASE_FLAG
- name: Publish
shell: bash
run: |
./gradlew publish -P toolchain=21 $RELEASE_FLAG
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}

- uses: actions/upload-artifact@v3
if: ${{ inputs.release }}
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/maven_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ jobs:
build:
name: Publish release
uses: ./.github/workflows/maven.yml
secrets: inherit
with:
release: true
1 change: 1 addition & 0 deletions .github/workflows/maven_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ jobs:
build:
name: Publish snapshot
uses: ./.github/workflows/maven.yml
secrets: inherit
35 changes: 34 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
// Main gradle plugin for building a Java library
id 'java-library'
id 'maven-publish'
// To create a shadow/fat jar that bundle up all dependencies
id 'com.github.johnrengelman.shadow' version '8.1.1'
// Add JavaFX dependencies
Expand All @@ -12,6 +13,7 @@ plugins {
ext.moduleName = 'qupath.extension.omero'
version = "0.1.1-rc1"
description = "QuPath extension to support image reading using OMERO APIs."
group = 'io.github.qupath'
ext.qupathVersion = gradle.ext.qupathVersion
ext.qupathJavaVersion = libs.versions.jdk.get()

Expand Down Expand Up @@ -117,4 +119,35 @@ repositories {
name "unidata.releases<"
url "https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases"
}
}
}

publishing {
repositories {
maven {
name = "SciJava"
def releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
def snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}

publications {
mavenJava(MavenPublication) {
from components.java

pom {
licenses {
license {
name = 'Apache License v2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
}
}
}
}