From 7fdb4a534e0c77520b10e26ccbf79732c36d1209 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Mon, 11 Aug 2025 15:22:42 +0900 Subject: [PATCH] fix github actions to obtain libssh version dynamically --- .github/workflows/build-freebsd.yml | 6 +++++- .github/workflows/build-macos.yml | 8 +++++--- .github/workflows/build-ubuntu.yml | 8 +++++--- .github/workflows/codeql.yml | 8 +++++--- .github/workflows/release.yml | 12 ++++++++---- .github/workflows/test.yml | 6 ++++-- 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-freebsd.yml b/.github/workflows/build-freebsd.yml index 476cf7a..19e5a1f 100644 --- a/.github/workflows/build-freebsd.yml +++ b/.github/workflows/build-freebsd.yml @@ -15,13 +15,17 @@ jobs: with: submodules: true + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch + - name: Build in FreeBSD uses: vmactions/freebsd-vm@v1 with: prepare: | pkg install -y git cmake run: | - patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build build/mscp -h diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index c02070a..00ca38b 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -22,6 +22,11 @@ jobs: with: submodules: true + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch + - name: install build dependency run: ./scripts/install-build-deps.sh @@ -29,9 +34,6 @@ jobs: id: brew-prefix run: echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_OUTPUT - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch - - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 120ecb6..a3867d0 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -22,14 +22,16 @@ jobs: with: submodules: true + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch + - name: install build dependency run: | sudo apt-get update sudo ./scripts/install-build-deps.sh - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch - - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0d1e058..8c1e162 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,14 +42,16 @@ jobs: with: submodules: true + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch + - name: install build dependency run: | sudo apt-get update sudo ./scripts/install-build-deps.sh - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5db0c6..de03da1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,10 @@ jobs: with: submodules: true - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch # TODO: just building docker does not require packages. fix CMakeLists - name: install build dependency @@ -43,8 +45,10 @@ jobs: with: submodules: true - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch - name: Set variables run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b97f545..0ec1fb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,8 +29,10 @@ jobs: with: submodules: true - - name: patch to libssh - run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch + - name: apply the patch to libssh + run: | + git -C libssh fetch --all --tags --prune + patch -d libssh -p1 < patch/$(git -C libssh describe).patch # TODO: just building docker images does not require libssh. fix CMakeLists - name: install build dependency