Initial windows workflow

This commit is contained in:
FriwiDev 2021-10-25 13:49:43 +02:00
parent aa10991509
commit 0bfcfd382c
7 changed files with 81 additions and 17 deletions

View File

@ -21,7 +21,7 @@ jobs:
name: Build name: Build
run: | run: |
chmod +x compile_linux.sh chmod +x compile_linux.sh
./compile_linux.sh amd64 ./compile_linux.sh amd64 Release
- -
name: Export artifacts name: Export artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -45,7 +45,7 @@ jobs:
name: Build name: Build
run: | run: |
chmod +x compile_linux.sh chmod +x compile_linux.sh
./compile_linux.sh 386 ./compile_linux.sh 386 Release
- -
name: Export artifacts name: Export artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2

39
.github/workflows/build-windows.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: build-windows
on:
push:
branches:
- 'master'
jobs:
amd64:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
-
name: Build
run: |
compile_windows.bat amd64 Release
-
name: Export artifacts
uses: actions/upload-artifact@v2
with:
name: windows-amd64.tar.gz
path: out/binary_distrib.tar.gz
i386:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
-
name: Build
run: |
compile_windows.bat 386 Release
-
name: Export artifacts
uses: actions/upload-artifact@v2
with:
name: windows-i386.tar.gz
path: out/binary_distrib.tar.gz

View File

@ -1,9 +1,9 @@
FROM friwidev/jcefdocker:linux-latest AS stage FROM friwidev/jcefdocker:linux-latest AS stage
#Specify a type to build: Debug or Release #Declare build type argument (Release or Debug)
ENV BUILD_TYPE Release ARG BUILD_TYPE
#Declare architecture argument #Declare architecture argument (386 or amd64)
ARG TARGETARCH ARG TARGETARCH
WORKDIR /builder WORKDIR /builder

7
DockerfileWindows Normal file
View File

@ -0,0 +1,7 @@
FROM friwidev/jcefdocker:windows-latest
WORKDIR C:/builder
#Copy and launch run script
COPY scripts/run_windows.bat .
ENTRYPOINT ["run_windows.bat"]

View File

@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash
if [ $# -eq 0 ] if [ ! $# -eq 2 ]
then then
echo "Usage: ./compile_linux.sh <architecture> [GYP_DEFINES]" echo "Usage: ./compile_linux.sh <architecture> <buildType>"
echo "" echo ""
echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)." echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)."
echo "GYP_DEFINES: When defined, performs a manual CEF build. Can be used to enable proprietary codec support. Wrap value with quotation marks." echo "buildType: either Release or Debug"
echo " To enable proprietary codecs use: proprietary_codecs=1 ffmpeg_branding=Chrome"
exit 1 exit 1
fi fi
#Execute buildx with linux dockerfile and output to current directory #Execute buildx with linux dockerfile and output to current directory
docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --file DockerfileLinux --output out . docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --file DockerfileLinux --output out .

15
compile_windows.bat Executable file
View File

@ -0,0 +1,15 @@
@echo off
if ("%2"=="")(
echo "Usage: compile_windows.bat <architecture> <buildType>"
echo ""
echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)."
echo "buildType: either Release or Debug"
exit 1
)
#Execute build with windows Dockerfile
docker build -t jcefbuild --file DockerfileWindows .
#Execute run with windows Dockerfile
docker run -v jcef:c:/jcef -v out:c:/out -e TARGETARCH=%1 -e BUILD_TYPE=%2 jcefbuild

View File

@ -1,29 +1,33 @@
@echo off @echo off
if "%1"=="32" (echo "Building 32-bit version") ^ if "%TARGETARCH%"=="386" (echo "Building 32-bit version") ^
else (echo "Building 64-bit version") else (echo "Building 64-bit version")
#Check residency of workdir #Check residency of workdir
cd C: cd C:
if exists jcef/README.md (echo "Found existing files to build") ^ if exists jcef/README.md (echo "Found existing files to build") ^
else (echo "Did not find files to build - cloning..." && git clone https://bitbucket.org/chromiumembedded/java-cef jcef) else (echo "Did not find files to build - cloning..." && rmdir /S /Q jcef && git clone https://bitbucket.org/chromiumembedded/java-cef jcef)
cd jcef cd jcef
#Prepare build dir #Prepare build dir
#rmdir /S /Q jcef_build
mkdir jcef_build && cd jcef_build mkdir jcef_build && cd jcef_build
#Load vcvars #Load vcvars
if "%1"=="32" ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat") ^ if "%TARGETARCH%"=="386" ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat") ^
else ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat") else ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat")
#Perform build #Perform build
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. cmake -G "Ninja" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
ninja ninja
#Compile java classes #Compile java classes
cd ../tools cd ../tools
if "%1"=="32" (compile.bat win32) else (compile.bat win64) if "%TARGETARCH%"=="386" (compile.bat win32) else (compile.bat win64)
#Create distribution #Create distribution
if "%1"=="32" (make_distrib.bat win32) else (make_distrib.bat win64) if "%TARGETARCH%"=="386" (make_distrib.bat win32) else (make_distrib.bat win64)
#Zip results to C:\out
if "%TARGETARCH%"=="386" (cd ../binary_distrib/win32) else (cd ../binary_distrib/win64)
del /F C:\out\binary_distrib.tar.gz
tar -czvf C:\out\binary_distrib.tar.gz *