From 85f610211227d9d24428ebb96dd65bb1edd8e4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 1 Jun 2024 15:17:34 +0200 Subject: [PATCH 1/2] Add reusable workflow for setting up SSH agent --- .github/actions/ssh/action.yml | 42 ++++++++++++++++++++++++++++++++++ .github/workflows/stage.yml | 21 +++++++---------- 2 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 .github/actions/ssh/action.yml diff --git a/.github/actions/ssh/action.yml b/.github/actions/ssh/action.yml new file mode 100644 index 00000000..5c4886ab --- /dev/null +++ b/.github/actions/ssh/action.yml @@ -0,0 +1,42 @@ +name: SSH setup +description: Set up the SSH agent + +inputs: + config: + description: The SSH configuration + required: true + key: + description: The private SSH key + required: true + known-hosts: + description: The list of known hosts + required: true + +runs: + using: composite + + steps: + - name: Configure SSH + shell: sh + env: + CONFIG: ${{ inputs.config }} + KNOWN_HOSTS: ${{ inputs.known-hosts }} + run: | + mkdir -p ~/.ssh + echo "${CONFIG}" > ~/.ssh/config + echo "${KNOWN_HOSTS}" > ~/.ssh/known_hosts + + - name: Start SSH agent + shell: bash + env: + SOCKET: /tmp/ssh-agent.sock + run: | + echo "SSH_AUTH_SOCK=${SOCKET}" >> $GITHUB_ENV + ssh-agent -a ${SOCKET} > /dev/null + + - name: Add SSH key + shell: bash + env: + KEY: ${{ inputs.key }} + run: | + ssh-add - <<< "${KEY}" diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index af3e3b17..177d84b1 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -1,10 +1,6 @@ name: Deploy (Staging) -on: - workflow_dispatch - -env: - SSH_AUTH_SOCK: /tmp/ssh-agent.sock +on: workflow_dispatch jobs: stage: @@ -17,6 +13,13 @@ jobs: 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: @@ -29,14 +32,6 @@ jobs: - name: Build with Gradle run: ./gradlew installDist - - name: Set up SSH agent - run: | - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" - mkdir -p ~/.ssh - echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config - echo '${{ vars.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - - name: Publish to staging server run: | rsync build/install/helma/ antville.dev:/ \ From 4b8d121266d2b5da2f9f747a8ab16834a60f2ce6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:07:00 +0000 Subject: [PATCH 2/2] Update Lucene packages to v2.9.4 --- modules/helma/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/helma/build.gradle b/modules/helma/build.gradle index f78f66d4..6b8c2b5e 100644 --- a/modules/helma/build.gradle +++ b/modules/helma/build.gradle @@ -1,8 +1,8 @@ dependencies { runtimeOnly 'ch.ethz.ganymed:ganymed-ssh2:build209' runtimeOnly 'net.sourceforge.jexcelapi:jxl:2.5.7' - runtimeOnly 'org.apache.lucene:lucene-analyzers:2.2.0' - runtimeOnly 'org.apache.lucene:lucene-core:2.2.0' + runtimeOnly 'org.apache.lucene:lucene-analyzers:2.9.4' + runtimeOnly 'org.apache.lucene:lucene-core:2.9.4' } jar.enabled = false