diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cdad2c55..c01702e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,12 +4,19 @@ on: workflow_dispatch jobs: deploy: - runs-on: antville + runs-on: ubuntu-latest environment: name: weblogs.at url: https://weblogs.at 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 b189f260..59d8f365 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ permissions: jobs: build: - runs-on: antville + runs-on: ubuntu-latest env: GH_TOKEN: ${{ github.token }} @@ -19,20 +19,27 @@ jobs: 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@v4 + - name: Build with Gradle run: ./gradlew assembleDist - name: Create release - # FIXME: Currently only outputs gh command; adapt for Forgejo run: | - echo gh release create "$GITHUB_REF_NAME" \ + gh release create "$GITHUB_REF_NAME" \ --repo "$GITHUB_REPOSITORY" \ --title "$(date +'%d %b %Y')" \ --generate-notes - name: Upload assets - # FIXME: Currently only outputs gh command; adapt for Forgejo run: | - echo gh release upload "$GITHUB_REF_NAME" \ + gh release upload "$GITHUB_REF_NAME" \ build/distributions/helma-*.* \ --clobber diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml deleted file mode 100644 index 847df5c7..00000000 --- a/.github/workflows/renovate.yml +++ /dev/null @@ -1,40 +0,0 @@ -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_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 17e693d4..eac49cc3 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -4,15 +4,31 @@ on: workflow_dispatch jobs: stage: - runs-on: antville + runs-on: ubuntu-latest environment: name: stage - url: ${{ vars.stage_url }} + url: https://antville-test.online 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@v4 + - name: Build with Gradle run: ./gradlew installDist diff --git a/build.gradle b/build.gradle index abf4287f..38eb392b 100644 --- a/build.gradle +++ b/build.gradle @@ -68,7 +68,7 @@ dependencies { implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1' implementation 'org.eclipse.jetty:jetty-servlet:9.4.56.v20240826' implementation 'org.eclipse.jetty:jetty-xml:9.4.56.v20240826' - implementation 'org.mozilla:rhino-all:1.8.0' + implementation 'org.mozilla:rhino:1.7.13' implementation 'org.sejda.imageio:webp-imageio:0.1.6' implementation 'xerces:xercesImpl:2.12.2' implementation 'xmlrpc:xmlrpc:2.0.1' @@ -172,7 +172,6 @@ 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/src/main/java/helma/main/Server.java b/src/main/java/helma/main/Server.java index 6155de3b..b747f11e 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 = "__version__"; + public static final String version = "🐜"; // build date public static final String buildDate = "__builddate__"; @@ -151,8 +151,13 @@ public class Server implements Runnable { public static void checkJavaVersion() { String javaVersion = System.getProperty("java.version"); - if ((javaVersion == null) || !javaVersion.startsWith("11")) { - System.err.println("This version of Helma requires Java 11 or greater."); + 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 (javaVersion == null) { // 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.");