Skip to content

Commit

Permalink
chore(deps): updated to java 21 and auto-replace versions on code on …
Browse files Browse the repository at this point in the history
…release (#93)

* chore(deps): updated to java 21

* chore: auto-update versions in code on release

* ci: updated standard wf to set java version
  • Loading branch information
chgl authored Oct 31, 2023
1 parent 5f81d40 commit 48bf884
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 15 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: read-all

jobs:
build:
uses: miracum/.github/.github/workflows/standard-build.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4
uses: miracum/.github/.github/workflows/standard-build.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0
permissions:
contents: read
id-token: write
Expand All @@ -32,7 +32,7 @@ jobs:
- build
steps:
- name: "Checkout code"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml -f tests/e2e/docker-compose.yml down --volumes --remove-orphans
lint:
uses: miracum/.github/.github/workflows/standard-lint.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4
uses: miracum/.github/.github/workflows/standard-lint.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0
permissions:
contents: read
pull-requests: write
Expand All @@ -77,11 +77,12 @@ jobs:
with:
codeql-languages: '["java", "python"]'
enable-codeql: true
java-version: "21"
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

release:
uses: miracum/.github/.github/workflows/standard-release.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4
uses: miracum/.github/.github/workflows/standard-release.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0
needs:
- build
- test
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/lint-pr-title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions: read-all

jobs:
check-pr-title:
name: Validate PR title
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 36 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,41 @@
}
}
],
"@semantic-release/github"
"@semantic-release/github",
[
"semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["src/main/resources/application.yml"],
"from": "version: .*",
"to": "version: ${nextRelease.version}",
"results": [
{
"file": "src/main/resources/application.yml",
"hasChanged": true
}
]
},
{
"files": ["build.gradle"],
"from": "version = \".*\"",
"to": "version = \"${nextRelease.version}\"",
"results": [
{
"file": "build.gradle",
"hasChanged": true
}
]
}
]
}
],
[
"@semantic-release/git",
{
"assets": ["src/main/resources/application.yml", "build.gradle"]
}
]
]
}
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM docker.io/library/gradle:8.3.0-jdk17@sha256:5f4ab273b15961c5f22969136ea884ca0343f1d8b2df5c4c6fe0ca8939b401b1 AS build
FROM docker.io/library/gradle:8.4.0-jdk21@sha256:97f1ca124aa6853e9b17d543d7ef75c8aecf64719606ade5862344a630fb927b AS build
WORKDIR /home/gradle/src
ENV GRADLE_USER_HOME /gradle

Expand All @@ -16,14 +16,12 @@ awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/",
java -Djarmode=layertools -jar build/libs/*.jar extract
EOF

FROM gcr.io/distroless/java17-debian12:nonroot@sha256:74aa41e4cb8b6cc76391c0679370be6bd75ebf60917a7f9fb5dd1b4c7b1a1854
FROM gcr.io/distroless/java21-debian12:nonroot@sha256:9517ee35e04822bd511011ae40e8a3f707a7a2a837ce45cf59d20b6d9c50c0b3
WORKDIR /opt/fhir-gateway
COPY --from=build /home/gradle/src/dependencies/ ./
COPY --from=build /home/gradle/src/spring-boot-loader/ ./
COPY --from=build /home/gradle/src/application/ ./

USER 65532:65532
ARG VERSION=0.0.0
ENV APP_VERSION=${VERSION} \
SPRING_PROFILES_ACTIVE="prod"
ENV SPRING_PROFILES_ACTIVE="prod"
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=50", "org.springframework.boot.loader.JarLauncher"]
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id "org.springframework.boot" version "3.1.4"
id "org.springframework.boot" version "3.1.5"
id "io.spring.dependency-management" version "1.1.3"
id "java"
id "jacoco"
id "com.diffplug.spotless" version "6.22.0"
}

group = "org.miracum.etl"
version = "0.0.1-SNAPSHOT"
sourceCompatibility = "17"
targetCompatibility = "17"
version = "0.0.1"
sourceCompatibility = "21"
targetCompatibility = "21"

configurations {
compileOnly {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fhir:
loinc: "http://loinc.org"

app:
version: 0.0.0-dev
version: 0.0.0

features:
use-load-balancer-optimized-connection-pool: false

0 comments on commit 48bf884

Please sign in to comment.