reduce CI #354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake | |
on: | |
push: | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: Get the version of OpenSSL | |
id: getversion | |
run: | | |
"${{ github.workspace }}/openssl-externalCMake/.github/Scripts-For-Actions/get-version.sh" >> "$GITHUB_OUTPUT" | |
outputs: | |
openssl_version: ${{ steps.getversion.outputs.OPENSSL_VERSION }} | |
package-source-unix: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
needs: get-version | |
env: | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
run: | | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | |
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ '"$(. /etc/os-release; echo ${VERSION_CODENAME})"' main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null | |
sudo apt-get update | |
sudo apt-get install cmake ninja-build perl build-essential zlib1g-dev | |
- name: run CMake + Ninja | |
run: | | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel -t package_source | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-Source-LF | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-Source.tar.xz | |
package-source-windows: | |
strategy: | |
fail-fast: false | |
runs-on: windows-latest | |
needs: get-version | |
env: | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- name: configure | |
shell: cmd | |
run: git config --global core.autocrlf true | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
shell: cmd | |
run: | | |
choco install cmake | |
choco install ninja | |
- name: run CMake + Ninja | |
shell: cmd | |
run: | | |
del /s /q C:\Strawberry\perl\bin\pkg-config.bat | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel -t package_source | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-Source-CRLF | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-Source.7z | |
build-ubuntu: | |
strategy: | |
fail-fast: false | |
continue-on-error: true | |
runs-on: ubuntu-22.04 | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: Ubuntu-x86_64 | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
run: | | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | |
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ '"$(. /etc/os-release; echo ${VERSION_CODENAME})"' main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null | |
sudo apt-get update | |
sudo apt-get install cmake ninja-build perl build-essential zlib1g-dev | |
- name: run CMake + Ninja | |
run: | | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=ON -DOPENSSL_ZLIB=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-linux-x86_64.tar.xz | |
build-macOS-x86_64: | |
strategy: | |
fail-fast: false | |
continue-on-error: true | |
runs-on: macos-13 | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: macOS-x86_64 | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: install cmake and ninja | |
run: | | |
while ! brew update; do :; done | |
brew install cmake ninja | |
- name: run CMake + Ninja | |
run: | | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DOPENSSL_ASM=ON -DOPENSSL_ZLIB=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-darwin64-x86_64-cc.tar.xz | |
build-macOS-arm64: | |
strategy: | |
fail-fast: false | |
continue-on-error: true | |
runs-on: macos-14 | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: macOS-arm64 | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: install cmake and ninja | |
run: | | |
while ! brew update; do :; done | |
brew install cmake ninja | |
- name: run CMake + Ninja | |
run: | | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="arm64" -DOPENSSL_ASM=OFF -DOPENSSL_ZLIB=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-darwin64-arm64-cc.tar.xz | |
build-macOS-unified: | |
strategy: | |
fail-fast: false | |
continue-on-error: true | |
runs-on: macos-14 | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: macOS-unified | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: install cmake and ninja | |
run: | | |
while ! brew update; do :; done | |
brew install cmake ninja | |
- name: run CMake + Ninja | |
run: | | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DOPENSSL_ASM=NO -DOPENSSL_ZLIB=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-darwin64-unified64.tar.xz | |
build-MinGW: | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- version: "12.2.0" | |
bit: "32" | |
arch: "i686" | |
url: "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/i686-12.2.0-release-posix-dwarf-msvcrt-rt_v10-rev2.7z" | |
OPENSSL_BUILD_PLATFORM: mingw | |
- version: "13.2.0" | |
bit: "64" | |
arch: "x86_64" | |
url: "https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-msvcrt-rt_v11-rev1.7z" | |
OPENSSL_BUILD_PLATFORM: mingw64 | |
continue-on-error: true | |
runs-on: windows-latest | |
name: "build-MinGW-GCC${{ matrix.toolchain.version }}-${{ matrix.toolchain.bit }}bit" | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: MinGW-GCC${{ matrix.toolchain.version }}-${{ matrix.toolchain.arch }} | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
run: | | |
choco install cmake | |
choco install ninja | |
- name: install MinGW toolchain | |
run: | | |
New-Item -Path "." -Name "mingw" -ItemType "directory"; | |
(New-Object System.Net.WebClient).DownloadFile("${{ matrix.toolchain.url }}","mingw/mingw.7z"); | |
cmd /c cd mingw "&&" 7z x mingw.7z | |
- name: run CMake + Ninja | |
shell: cmd | |
run: | | |
del /s /q C:\Strawberry\perl\bin\pkg-config.bat | |
set path=${{ github.workspace }}\mingw\mingw${{ matrix.toolchain.bit }}\\bin;%path% | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-${{ matrix.toolchain.OPENSSL_BUILD_PLATFORM }}.7z | |
build-msvc: | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- version: "2022" | |
runson: "2022" | |
call: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat | |
bit: "64" | |
arch: "x86_64" | |
OPENSSL_BUILD_PLATFORM: VC-WIN64A | |
- version: "2019" | |
runson: "2019" | |
call: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat | |
bit: "32" | |
arch: "i686" | |
OPENSSL_BUILD_PLATFORM: VC-WIN32 | |
continue-on-error: true | |
runs-on: windows-${{ matrix.toolchain.runson }} | |
name: "build-MSVC${{ matrix.toolchain.version }}-${{ matrix.toolchain.bit }}bit" | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: MSVC${{ matrix.toolchain.version }}-${{ matrix.toolchain.arch }} | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
run: | | |
choco install cmake | |
choco install ninja | |
choco install nasm | |
- name: run CMake + Ninja | |
shell: cmd | |
run: | | |
del /s /q C:\Strawberry\perl\bin\pkg-config.bat | |
call "${{ matrix.toolchain.call }}" | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=ON -DOPENSSL_NASM=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-${{ matrix.toolchain.OPENSSL_BUILD_PLATFORM }}.7z | |
# The first NDK version which supports CMake is r13, but since then GCC is no longer supported and is broken (https://github.com/android/ndk/issues/67 is closed as won't fix) | |
# clang on NDK doesn't support the "-mandroid" flag OpenSSL sets. We'd use sed to remove them from command line when using perl-based Configure | |
# TODO: make a CMake toolchain file for known-good NDK r10e (Did I make it in the LibreSSL build project? I'd go search the trash) | |
# use r17c for build testing on GCC. OpenSSL 1.1.0 didn't support Android x86_64 so no build test for it. | |
build-android: | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- arch: "armeabi-v7a" | |
platform: "16" | |
OPENSSL_BUILD_PLATFORM: android-armeabi | |
- arch: "x86" | |
platform: "16" | |
OPENSSL_BUILD_PLATFORM: android-x86 | |
- arch: "arm64-v8a" | |
platform: "21" | |
OPENSSL_BUILD_PLATFORM: android64-aarch64 | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
name: "build-Android-${{ matrix.toolchain.arch }}" | |
needs: get-version | |
env: | |
FS_OPENSSL_PACKAGE_STR: Android-${{ matrix.toolchain.arch }} | |
FS_OPENSSL_VERSION_STR: ${{ needs.get-version.outputs.openssl_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: openssl-externalCMake | |
- name: add CMake repository and needed softwares | |
run: | | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | |
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ '"$(. /etc/os-release; echo ${VERSION_CODENAME})"' main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null | |
sudo apt-get update | |
sudo apt-get install cmake ninja-build perl | |
- name: download Android NDK r17c | |
run: | | |
wget -O ndk.zip https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip | |
unzip ndk.zip | |
- name: run CMake + Ninja | |
# need to unset all Android related stuff before using our own NDK | |
run: | | |
unset ANDROID_HOME ANDROID_NDK ANDROID_NDK_HOME ANDROID_NDK_LATEST_HOME ANDROID_NDK_ROOT ANDROID_SDK_ROOT || : | |
mkdir -p "build" | |
cd "build" | |
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/android-ndk-r17c/build/cmake/android.toolchain.cmake" -DANDROID_ABI=${{ matrix.toolchain.arch }} -DANDROID_PLATFORM=android-${{ matrix.toolchain.platform }} -DANDROID_TOOLCHAIN=gcc -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }}" -DOPENSSL_ASM=ON -DOPENSSL_ZLIB=ON -DOPENSSL_THREADS=ON "${{ github.workspace }}/openssl-externalCMake" | |
cmake --build . --parallel | |
cmake --build . --parallel -t package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openssl${{ env.FS_OPENSSL_VERSION_STR }}-${{ env.FS_OPENSSL_PACKAGE_STR }} | |
path: build/OpenSSL-${{ env.FS_OPENSSL_VERSION_STR }}-${{ matrix.toolchain.OPENSSL_BUILD_PLATFORM }}.tar.xz |