diff --git a/.github/workflows/publishjar.yml b/.github/workflows/publishjar.yml new file mode 100644 index 00000000..7bd155e1 --- /dev/null +++ b/.github/workflows/publishjar.yml @@ -0,0 +1,37 @@ +name: Create and publish a Spring Boot jar/Spring Boot LaunchScript Jar + +on: + push: + tags: + - 'v*' + +jobs: + build-artifacts: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build jars with Gradle + run: | + ./gradlew build -x test + + - name: Release Jars + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + build/libs/encore*.jar + diff --git a/Dockerfile b/Dockerfile index 41387793..3f7905e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ${DOCKER_BASE_IMAGE} LABEL org.opencontainers.image.url="https://github.com/svt/encore" LABEL org.opencontainers.image.source="https://github.com/svt/encore" -COPY build/libs/encore.jar /app/encore.jar +COPY build/libs/encore*.jar /app/encore.jar COPY bin/start.sh /app/start.sh WORKDIR /app diff --git a/build.gradle.kts b/build.gradle.kts index c2597fff..32024510 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,9 @@ plugins { id("org.springdoc.openapi-gradle-plugin") version "1.3.3" } + +project.version = scmVersion.version + apply(from = "checks.gradle") group = "se.svt.oss" @@ -49,6 +52,12 @@ repositories { mavenCentral() } +//don't build the extra plain jars that was auto-added in Spring Boot 2.5.0, +//https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable.and-plain-archives +tasks.getByName("jar") { + enabled = false +} + configurations { implementation { exclude(module = "spring-boot-starter-logging")