diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c01702e5..5acc94a2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,19 +4,12 @@ on: workflow_dispatch jobs: deploy: - runs-on: ubuntu-latest + runs-on: antville environment: - name: weblogs.at - url: https://weblogs.at + name: antville.org + url: https://antville.org steps: - - name: Set up SSH agent - uses: antville/helma/.github/actions/ssh@helma-🐜 - with: - config: ${{ vars.SSH_CONFIG }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - known-hosts: ${{ vars.SSH_KNOWN_HOSTS }} - - name: Copy files to production server run: ssh staging-server deploy-helma diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35333503..f7aa7874 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,45 +1,48 @@ name: Release on: + workflow_dispatch: push: - tags: - - 'v*' + tags: '2*' permissions: contents: write jobs: build: - runs-on: ubuntu-latest + runs-on: antville env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} LC_TIME: en_US.UTF-8 + TODAY: $(date +'%d %b %Y') steps: - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v3 - - name: Build with Gradle run: ./gradlew assembleDist - name: Create release + uses: actions/forgejo-release@v2 + with: + direction: upload + url: https://code.host.antville.org + token: ${{ github.token }} + title: ${{ env.TODAY }} + release-dir: build/distributions + release-notes-assistant: true + verbose: true + + - name: Create release at GitHub run: | gh release create "$GITHUB_REF_NAME" \ --repo "$GITHUB_REPOSITORY" \ - --title "$(date +'%d %b %Y')" \ + --title "${{ env.TODAY }}" \ --generate-notes - - name: Upload assets + - name: Upload release assets to GitHub run: | - gh release upload "$GITHUB_REF_NAME" \ - build/distributions/helma-*.* \ + gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \ + --repo "$GITHUB_REPOSITORY" \ --clobber diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml new file mode 100644 index 00000000..e470128c --- /dev/null +++ b/.github/workflows/renovate.yml @@ -0,0 +1,44 @@ +name: Run Renovate + +on: + schedule: + - cron: "13 * * * *" + workflow_dispatch: + +jobs: + renovate: + runs-on: antville + + steps: + - uses: actions/checkout@v4 + + - name: Run Renovate + # See + # debug | info | warn | error | fatal + run: LOG_LEVEL=info npx renovate + env: + # Renovate is using this token to retrieve release notes + GITHUB_COM_TOKEN: ${{ secrets.renovate_github_com_token }} + # Autodiscover is better suited for an extra repo running Renovate on all desired repos + #RENOVATE_AUTODISCOVER: 'true' + RENOVATE_CONFIG_FILE: renovate.json + RENOVATE_ENDPOINT: ${{ github.api_url }} + RENOVATE_GIT_AUTHOR: Renovate Bot + #RENOVATE_GIT_IGNORED_AUTHORS: + # - 29139614+renovate[bot]@users.noreply.github.com + RENOVATE_IGNORE_PR_AUTHOR: 'true' + RENOVATE_LOG_FILE: renovate-log.ndjson + RENOVATE_LOG_FILE_LEVEL: debug + RENOVATE_PLATFORM: gitea + RENOVATE_REPOSITORIES: ${{ github.repository }} + RENOVATE_REPOSITORY_CACHE: 'enabled' + # github.token is not working here, it lacks some permissions required by Renovate + RENOVATE_TOKEN: ${{ secrets.renovate_token }} + + - name: Save log file + # FIXME: v4 of this action causes an error on Forgejo (“You must configure a GitHub token”) + uses: actions/upload-artifact@v3 + if: always() + with: + name: renovate-log.ndjson + path: renovate-log.ndjson diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 4f015093..17e693d4 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -4,31 +4,15 @@ on: workflow_dispatch jobs: stage: - runs-on: ubuntu-latest + runs-on: antville environment: name: stage - url: https://antville-test.online + url: ${{ vars.stage_url }} steps: - uses: actions/checkout@v4 - - name: Set up SSH agent - uses: ./.github/actions/ssh - with: - config: ${{ vars.SSH_CONFIG }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - known-hosts: ${{ vars.SSH_KNOWN_HOSTS }} - - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v3 - - name: Build with Gradle run: ./gradlew installDist diff --git a/build.gradle b/build.gradle index 2f31f466..84d471ed 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'application' - id 'com.github.jk1.dependency-license-report' version '2.7' + id 'com.github.jk1.dependency-license-report' version '2.9' } import org.apache.tools.ant.filters.FixCrLfFilter @@ -58,18 +58,18 @@ configurations { } dependencies { - implementation 'com.google.code.gson:gson:2.11.0' - implementation 'commons-codec:commons-codec:1.17.0' + implementation 'com.google.code.gson:gson:2.12.1' + implementation 'commons-codec:commons-codec:1.18.0' implementation 'org.apache.commons:commons-fileupload2-core:2.0.0-M2' implementation 'org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1' - implementation 'commons-logging:commons-logging:1.3.2' - implementation 'commons-net:commons-net:3.10.0' + implementation 'commons-logging:commons-logging:1.3.5' + implementation 'commons-net:commons-net:3.11.1' implementation 'com.sun.mail:javax.mail:1.6.2' implementation 'jakarta.servlet:jakarta.servlet-api:5.0.0' implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1' implementation 'org.eclipse.jetty.ee9:jetty-ee9-servlet:12.0.9' implementation 'org.eclipse.jetty:jetty-xml:12.0.9' - implementation 'org.mozilla:rhino:1.7.13' + implementation 'org.mozilla:rhino-all:1.8.0' implementation 'org.sejda.imageio:webp-imageio:0.1.6' implementation 'xerces:xercesImpl:2.12.2' implementation 'xmlrpc:xmlrpc:2.0.1' @@ -173,6 +173,7 @@ tasks.register('processSource', Sync) { line -> line .replaceAll('__builddate__', new Date().format("d MMM yyyy")) .replaceAll('__commithash__', gitOutput.toString().trim()) + .replaceAll('__version__', version) } into "${project.buildDir}/src" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..e18bc253 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 7101f8e4..9b42019c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/src/dist/extras/helma.service b/src/dist/extras/helma.service index 308093aa..7d42310b 100644 --- a/src/dist/extras/helma.service +++ b/src/dist/extras/helma.service @@ -18,7 +18,7 @@ ExecStart = /usr/bin/java -server \ -jar launcher.jar \ -w 8080 -x 8081 -ExecReload = touch apps.properties && touch server.properties +ExecReload = /bin/sh -c 'touch apps.properties && touch server.properties' ExecStop = /bin/kill -15 $MAINPID [Install] diff --git a/src/main/java/helma/main/Server.java b/src/main/java/helma/main/Server.java index b747f11e..88d70db7 100644 --- a/src/main/java/helma/main/Server.java +++ b/src/main/java/helma/main/Server.java @@ -36,7 +36,7 @@ import helma.util.ResourceProperties; */ public class Server implements Runnable { // version string - public static final String version = "🐜"; + public static final String version = "__version__"; // build date public static final String buildDate = "__builddate__"; @@ -149,17 +149,13 @@ public class Server implements Runnable { * check if we are running on a Java 2 VM - otherwise exit with an error message */ public static void checkJavaVersion() { - String javaVersion = System.getProperty("java.version"); + String javaVersion = System.getProperty("java.version", "0"); + int majorVersion = Integer.parseInt(javaVersion.split("\\.")[0]); - if ((javaVersion == null) || javaVersion.startsWith("1.5") - || javaVersion.startsWith("1.4") - || javaVersion.startsWith("1.3") - || javaVersion.startsWith("1.2") - || javaVersion.startsWith("1.1") - || javaVersion.startsWith("1.0")) { - System.err.println("This version of Helma requires Java 1.6 or greater."); + if (majorVersion < 11) { + System.err.println("This version of Helma requires Java 11 or greater."); - if (javaVersion == null) { // don't think this will ever happen, but you never know + if (majorVersion == 0) { // don't think this will ever happen, but you never know System.err.println("Your Java Runtime did not provide a version number. Please update to a more recent version."); } else { System.err.println("Your Java Runtime is version " + javaVersion +