Skip to content
Merged
10 changes: 5 additions & 5 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:

- name: Set up Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
uses: nttld/setup-ndk@v1.6.0
with:
ndk-version: r26d
add-to-path: false
Expand Down Expand Up @@ -116,7 +116,7 @@ runs:
} >> "$GITHUB_ENV"

- name: Checkout OpenSSL
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: openssl/openssl
ref: refs/tags/openssl-${{ inputs.openssl_version }}
Expand All @@ -134,7 +134,7 @@ runs:
make install_sw

- name: Checkout libssh2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libssh2/libssh2
ref: refs/tags/libssh2-${{ inputs.libssh2_version }}
Expand All @@ -160,7 +160,7 @@ runs:
cmake --build bld --target install -- -j"$NCPU"

- name: Checkout libgit2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand Down Expand Up @@ -200,7 +200,7 @@ runs:
cp "$LIBGIT2_INSTALL/lib/libgit2-experimental.so" "$OUTPUT_DIR/libgit2.so"

- name: Upload Android artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: cache-android-${{ inputs.architecture }}
path: /tmp/export/**
8 changes: 4 additions & 4 deletions .github/actions/build-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ runs:
using: composite
steps:
- name: Checkout OpenSSL
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: openssl/openssl
ref: refs/tags/openssl-${{ inputs.openssl_version }}
path: ./openssl

- name: Checkout libssh2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libssh2/libssh2
ref: refs/tags/libssh2-${{ inputs.libssh2_version }}
path: ./libssh2

- name: Checkout libgit2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand Down Expand Up @@ -163,7 +163,7 @@ runs:
cp -R "$libgit2_install/include/." "$output_dir/libgit2/include/"

- name: Upload iOS slice
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.artifact_name }}
path: /tmp/git2dart-ios-${{ inputs.ios_sdk }}-${{ inputs.architecture }}/export/**
6 changes: 3 additions & 3 deletions .github/actions/build-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
mkdir /tmp/export

- name: Checkout libssh2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libssh2/libssh2
ref: refs/tags/libssh2-${{ inputs.libssh2_version }}
Expand All @@ -34,7 +34,7 @@ runs:
cp /tmp/libssh2/install/lib/libssh2.so /tmp/export/libssh2.so

- name: Checkout libgit2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand All @@ -54,7 +54,7 @@ runs:
run: cp /tmp/libgit2/install/lib/libgit2-experimental.so /tmp/export/libgit2.so

- name: Cache git2 library
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: cache-linux
path: /tmp/export/**
6 changes: 3 additions & 3 deletions .github/actions/build-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
# run: brew install openssl cmake

- name: Checkout libssh2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libssh2/libssh2
ref: refs/tags/libssh2-${{ inputs.libssh2_version }}
Expand All @@ -35,7 +35,7 @@ runs:
cmake --build . --target install

- name: Checkout libgit2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand Down Expand Up @@ -118,7 +118,7 @@ runs:
otool -L export/libcrypto.3.dylib

- name: Cache git2 library
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: cache-macos
path: export/**
72 changes: 58 additions & 14 deletions .github/actions/build-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,60 @@ inputs:
runs:
using: composite
steps:
- name: Install dependencies
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0

- name: Verify dependencies
shell: pwsh
run: choco install openssl cmake -y
run: |
cmake --version
ninja --version
openssl version

$openssl = Get-Command openssl -ErrorAction Stop
$opensslBinRoot = Split-Path (Split-Path $openssl.Source -Parent) -Parent
$opensslRoot = @(
$opensslBinRoot,
'C:/Program Files/OpenSSL',
'C:/Program Files/OpenSSL-Win64'
) | Where-Object {
$libcrypto = @(
"$_/lib/libcrypto.lib",
"$_/lib/VC/x64/MD/libcrypto.lib"
) | Where-Object { Test-Path $_ } | Select-Object -First 1
$libssl = @(
"$_/lib/libssl.lib",
"$_/lib/VC/x64/MD/libssl.lib"
) | Where-Object { Test-Path $_ } | Select-Object -First 1

(Test-Path "$_/include/openssl/ssl.h") -and
$libcrypto -and
$libssl
} | Select-Object -First 1

if (-not $opensslRoot) {
Write-Error 'Could not find OpenSSL headers and import libraries'
exit 1
}

$opensslCryptoLibrary = @(
"$opensslRoot/lib/libcrypto.lib",
"$opensslRoot/lib/VC/x64/MD/libcrypto.lib"
) | Where-Object { Test-Path $_ } | Select-Object -First 1
$opensslSslLibrary = @(
"$opensslRoot/lib/libssl.lib",
"$opensslRoot/lib/VC/x64/MD/libssl.lib"
) | Where-Object { Test-Path $_ } | Select-Object -First 1

"OPENSSL_ROOT_DIR=$opensslRoot" >> $env:GITHUB_ENV
"OPENSSL_CRYPTO_LIBRARY=$opensslCryptoLibrary" >> $env:GITHUB_ENV
"OPENSSL_SSL_LIBRARY=$opensslSslLibrary" >> $env:GITHUB_ENV
Write-Host "OpenSSL root: $opensslRoot"
Write-Host "OpenSSL crypto library: $opensslCryptoLibrary"
Write-Host "OpenSSL ssl library: $opensslSslLibrary"

- name: Checkout libssh2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libssh2/libssh2
ref: refs/tags/libssh2-${{ inputs.libssh2_version }}
Expand All @@ -25,15 +73,13 @@ runs:
shell: pwsh
run: |
cd libssh2
mkdir build
cd build
cmake -DCRYPTO_BACKEND=OpenSSL -DCMAKE_INSTALL_PREFIX=D:/libssh2/install ..
cmake --build . --config Release --target install
cmake -S . -B build -G Ninja -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" -DOPENSSL_CRYPTO_LIBRARY="$env:OPENSSL_CRYPTO_LIBRARY" -DOPENSSL_SSL_LIBRARY="$env:OPENSSL_SSL_LIBRARY" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=D:/libssh2/install
cmake --build build --parallel --target install
mkdir -p D:/export
copy D:/libssh2/install/bin/libssh2.dll D:/export/libssh2.dll

- name: Checkout libgit2
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand All @@ -43,18 +89,16 @@ runs:
shell: pwsh
run: |
cd libgit2
mkdir build
cd build
cmake -DUSE_SSH=libssh2 -DBUILD_TESTS=ON -DEXPERIMENTAL_SHA256=ON -DCMAKE_INSTALL_PREFIX=D:/libgit2/install -DLIBSSH2_INCLUDE_DIR=D:/libssh2/install/include -DLIBSSH2_LIBRARY=D:/libssh2/install/lib/libssh2.lib ..
cmake --build . --config Release --target install
.\Release\libgit2_tests.exe
cmake -S . -B build -G Ninja -DUSE_SSH=libssh2 -DBUILD_TESTS=ON -DEXPERIMENTAL_SHA256=ON -DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" -DOPENSSL_CRYPTO_LIBRARY="$env:OPENSSL_CRYPTO_LIBRARY" -DOPENSSL_SSL_LIBRARY="$env:OPENSSL_SSL_LIBRARY" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=D:/libgit2/install -DLIBSSH2_INCLUDE_DIR=D:/libssh2/install/include -DLIBSSH2_LIBRARY=D:/libssh2/install/lib/libssh2.lib
cmake --build build --parallel --target install
.\build\libgit2_tests.exe

- name: Export git2 library
shell: pwsh
run: copy D:/libgit2/install/bin/git2-experimental.dll D:/export/libgit2.dll

- name: Cache git2 library
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: cache-windows
path: D:/export/**
4 changes: 2 additions & 2 deletions .github/actions/generate-bindings/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
repository: libgit2/libgit2
ref: refs/tags/v${{ inputs.libgit2_version }}
Expand All @@ -34,7 +34,7 @@ runs:
dart run ffigen --config ffigen.yaml --ignore-source-errors

- name: Cache git2 library
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: cache-bindings
path: lib/src/bindings.dart
Loading
Loading