test add github release [openvpnadapter] #205
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: libssh-macos | |
on: [push] | |
env: | |
# Expected filename: https://zlib.net/zlib-${{env.ZLIB_VERSION}}.tar.gz | |
ZLIB_VERSION: 1.3.1 | |
# Expected filename: https://www.openssl.org/source/openssl-${{env.OPENSSL_VERSION}}.tar.gz | |
OPENSSL_VERSION: 3.0.13 | |
# Exoected filename: ${{env.LIBSSH_SOURCE}}libssh-${{env.LIBSSH_VERSION}}.tar.xz | |
LIBSSH_SOURCE: https://www.libssh.org/files/0.10/ | |
LIBSSH_VERSION: 0.10.6 | |
jobs: | |
Build-LibSSH-MacOS: | |
runs-on: macos-12 | |
if: | | |
contains(github.event.head_commit.message, '[all]') || | |
contains(github.event.head_commit.message, '[macos]') || | |
contains(github.event.head_commit.message, '[macos-libssh]') || | |
contains(github.event.head_commit.message, '[libssh]') | |
strategy: | |
matrix: | |
arch: [x86_64] | |
# no-crypto=yes: builds version with all crypto disabled | |
# no-crypto=no: builds version with all crypto enabled (where required dependencies are available) | |
no_crypto: | |
- no | |
# - yes | |
steps: | |
- name: Get dependencies | |
run: | | |
# Get and unpack zlibx | |
curl -LOJ https://zlib.net/zlib-${{env.ZLIB_VERSION}}.tar.gz | |
tar -xzf zlib-${{env.ZLIB_VERSION}}.tar.gz | |
# Get and unpack openssl | |
curl -LOJ https://www.openssl.org/source/openssl-${{env.OPENSSL_VERSION}}.tar.gz | |
tar -xzf openssl-${{env.OPENSSL_VERSION}}.tar.gz | |
# Get and unpack libssh | |
curl -LOJ ${{env.LIBSSH_SOURCE}}libssh-${{env.LIBSSH_VERSION}}.tar.xz | |
tar -xf libssh-${{env.LIBSSH_VERSION}}.tar.xz | |
cd libssh-${{env.LIBSSH_VERSION}} | |
mkdir build | |
- name: Build zlib | |
run: | | |
cd zlib-${{env.ZLIB_VERSION}} | |
cmake . | |
make zlibstatic | |
cp ./libz.a ${{github.workspace}}/libssh-${{env.LIBSSH_VERSION}}/build/libz.a | |
- name: Build openssl | |
run: | | |
cd openssl-${{env.OPENSSL_VERSION}} | |
./Configure no-asm no-shared darwin64-x86_64-cc | |
make | |
- name: Build libssh | |
run: | | |
cd libssh-${{env.LIBSSH_VERSION}}/build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENSSL_USE_STATIC_LIBS=TRUE -DWITH_GSSAPI=OFF -DBUILD_SHARED_LIBS=OFF -DOPENSSL_ROOT_DIR=${{github.workspace}}/openssl-${{env.OPENSSL_VERSION}} -DZLIB_ROOT_DIR=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}} -DZLIB_LIBRARY=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}}/libz.a -DZLIB_INCLUDE=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}} | |
make ssh | |
- name: Upload Artifact | |
uses: actions/[email protected] | |
with: | |
name: libssh-macos-${{ matrix.arch }} | |
path: ${{ github.workspace }}/libssh-${{env.LIBSSH_VERSION}}/build | |
if-no-files-found: error | |
retention-days: 7 | |
github-release: | |
name: GitHub Release | |
needs: Build-LibSSH-MacOS | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v2 | |
- name: Setup | Artifacts | |
uses: actions/download-artifact@v2 | |
- name: Setup | Checksums | |
run: for file in $(find ./ -name '*.a' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | |
- name: Zip ALL | |
run: for file in *; do zip -r ${file%.*}.zip $file; done | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: "*.zip" | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |