Introduce w32 and w64 in the CI ##build

This commit is contained in:
pancake 2021-01-31 00:40:40 +01:00 committed by GitHub
parent ae0a733d5e
commit f80c847376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 118 additions and 49 deletions

View File

@ -8,27 +8,8 @@ on:
# schedule:
# - cron: '0 0 * * 1'
# python sys\meson.py --release --backend vs2019 --shared --install --prefix="%cd%\radar e2_dist" --webui
jobs:
# Windows
# windows-mingw:
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Windows Dependencies
# run: |
# pip install meson ninja r2pipe
# - name: Building Radare2
# run: |
# meson --buildtype=release --prefix=$PWD\radare2_dist build
# ninja -C build
# ninja -C build install
# - name: Pub
# uses: actions/upload-artifact@v2
# with:
# path: radare2_dist/*
build-resymlink:
name: linux-acr-resymlink
runs-on: ubuntu-20.04
@ -78,63 +59,87 @@ jobs:
cd ..
find "/tmp/r 2"
LD_LIBRARY_PATH="/tmp/r 2/lib/x86_64-linux-gnu/" "/tmp/r 2/bin/r2" -v
windows-dist:
name: windows-${{ matrix.name }}
# if: contains(github.ref, 'master') || contains(github.ref, 'ci-')
w32-meson:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
name: [vs2019_static, clang_cl]
include:
- name: vs2019_static
compiler: cl
meson_options: --default-library=static -Dstatic_runtime=true
- name: clang_cl
compiler: clang-cl
meson_options: --default-library=shared
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install meson ninja r2pipe
- name: Extract r2 version
shell: pwsh
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
id: extract_version
pip install meson ninja r2pipe wget
- name: Build with meson + ninja
shell: pwsh
run: |
.github\vsdevenv.ps1
meson --buildtype=release --prefix=$PWD\radare2-install build ${{ matrix.meson_options }}
meson --buildtype=release --prefix=$PWD\radare2-install build
ninja -C build
ninja -C build install
- name: Create zip artifact
shell: pwsh
run: 7z a radare2-git.zip $PWD\radare2-install
- uses: actions/upload-artifact@v2
with:
name: radare2-git.zip
name: radare2-w32-git.zip
path: .\radare2-git.zip
- uses: actions/checkout@v2
with:
repository: radareorg/radare2-win-installer
path: ./radare2-win-installer
- name: Extract r2 version for the installer
shell: pwsh
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
id: extract_version
- name: Create installer
shell: pwsh
run: iscc radare2-win-installer\radare2.iss /DRadare2Location=..\radare2-install\* /DLicenseLocation=..\COPYING.LESSER /DIcoLocation=radare2.ico /DMyAppVersion=${{ steps.extract_version.outputs.branch }}
- uses: actions/upload-artifact@v2
with:
name: radare2-git.zip
path: radare2-git.zip
name: radare2-w32-installer-git.exe
path: radare2-win-installer\Output\radare2.exe
w64-meson:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install meson ninja r2pipe wget
- name: Build with meson + ninja
shell: pwsh
run: |
# cmd '/c call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" "x86_64"'
bash sys/source_bat.bash 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' "x86_64"
# meson_options: --default-library=shared|static -Dstatic_runtime=true --backend vs2019
meson --buildtype=release --prefix=$PWD\radare2-install build
ninja -C build
ninja -C build install
- name: Create zip artifact
run: 7z a radare2-git.zip $PWD\radare2-install
- uses: actions/upload-artifact@v2
with:
name: radare2_installer-git.exe
name: radare2-w64-git.zip
path: .\radare2-git.zip
- uses: actions/checkout@v2
with:
repository: radareorg/radare2-win-installer
path: ./radare2-win-installer
- name: Extract r2 version for the installer
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
id: extract_version
- name: Create installer
shell: pwsh
run: iscc radare2-win-installer\radare2.iss /DRadare2Location=..\radare2-install\* /DLicenseLocation=..\COPYING.LESSER /DIcoLocation=radare2.ico /DMyAppVersion=${{ steps.extract_version.outputs.branch }}
- uses: actions/upload-artifact@v2
with:
name: radare2-w64-installer-git.zip
path: radare2-win-installer\Output\radare2.exe
# LINUX
linux-static:
runs-on: ubuntu-latest
@ -318,7 +323,7 @@ jobs:
name: radare2_iphoneos-arm64.zip
path: ./dist/cydia/radare2*/*.deb
android-arm64:
android-acr-aarch64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -336,7 +341,7 @@ jobs:
name: radare2-android-aarch64.tar.gz
path: radare2*android*aarch64.tar.gz
android-build:
android-meson:
runs-on: ubuntu-latest
strategy:
fail-fast: false

64
sys/source_bat.bash Executable file
View File

@ -0,0 +1,64 @@
# Copyright 2019 Wason Technology, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if [ $# -eq 0 ]
then
echo "No bat file specified"
return
fi
#echo `dirname "$(readlink -f "$_")"`
___update_env_func___() {
tmpbat=$(mktemp --suffix .bat)
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not create temporary bat file"
return $rc
fi
echo "@echo off " >> $tmpbat
echo "call \"$@\" 1>&2 " >> $tmpbat
echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat
echo "printenv " >> $tmpbat
echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not write temporary bat file"
return $rc
fi
tmpbat_win=$(basename $tmpbat)
env_data=$(cmd "/c call %TEMP%\\$tmpbat_win ")
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not run temporary bat file"
return $rc
fi
echo
echo
echo
#Space at the end is lost for some reason,
#save and restore PS1
ps1_old=$PS1
while read -r line; do
echo "export $line"
export "$line"
done <<< "$env_data"
export PS1="$ps1_old"
}
___update_env_func___ $@
unset -f ___update_env_func___
cd `pwd`