mirror of
				https://github.com/jcefmaven/jcefbuild.git
				synced 2025-11-04 08:33:40 +08:00 
			
		
		
		
	Initial windows workflow
This commit is contained in:
		
							
								
								
									
										4
									
								
								.github/workflows/build-linux.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/build-linux.yml
									
									
									
									
										vendored
									
									
								
							@@ -21,7 +21,7 @@ jobs:
 | 
			
		||||
        name: Build
 | 
			
		||||
        run: |
 | 
			
		||||
          chmod +x compile_linux.sh
 | 
			
		||||
          ./compile_linux.sh amd64
 | 
			
		||||
          ./compile_linux.sh amd64 Release
 | 
			
		||||
      -
 | 
			
		||||
        name: Export artifacts
 | 
			
		||||
        uses: actions/upload-artifact@v2
 | 
			
		||||
@@ -45,7 +45,7 @@ jobs:
 | 
			
		||||
        name: Build
 | 
			
		||||
        run: |
 | 
			
		||||
          chmod +x compile_linux.sh
 | 
			
		||||
          ./compile_linux.sh 386
 | 
			
		||||
          ./compile_linux.sh 386 Release
 | 
			
		||||
      -
 | 
			
		||||
        name: Export artifacts
 | 
			
		||||
        uses: actions/upload-artifact@v2
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										39
									
								
								.github/workflows/build-windows.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								.github/workflows/build-windows.yml
									
									
									
									
										vendored
									
									
										Normal 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
 | 
			
		||||
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
FROM friwidev/jcefdocker:linux-latest AS stage
 | 
			
		||||
 | 
			
		||||
#Specify a type to build: Debug or Release
 | 
			
		||||
ENV BUILD_TYPE Release
 | 
			
		||||
#Declare build type argument (Release or Debug)
 | 
			
		||||
ARG BUILD_TYPE
 | 
			
		||||
 | 
			
		||||
#Declare architecture argument
 | 
			
		||||
#Declare architecture argument (386 or amd64)
 | 
			
		||||
ARG TARGETARCH
 | 
			
		||||
 | 
			
		||||
WORKDIR /builder
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								DockerfileWindows
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								DockerfileWindows
									
									
									
									
									
										Normal 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"]
 | 
			
		||||
@@ -1,15 +1,14 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ $# -eq 0 ]
 | 
			
		||||
if [ ! $# -eq 2 ]
 | 
			
		||||
  then
 | 
			
		||||
    echo "Usage: ./compile_linux.sh <architecture> [GYP_DEFINES]"
 | 
			
		||||
    echo "Usage: ./compile_linux.sh <architecture> <buildType>"
 | 
			
		||||
    echo ""
 | 
			
		||||
    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 "    To enable proprietary codecs use: proprietary_codecs=1 ffmpeg_branding=Chrome"
 | 
			
		||||
    echo "buildType: either Release or Debug"
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#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
									
								
							
							
						
						
									
										15
									
								
								compile_windows.bat
									
									
									
									
									
										Executable 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
 | 
			
		||||
@@ -1,29 +1,33 @@
 | 
			
		||||
@echo off
 | 
			
		||||
 | 
			
		||||
if "%1"=="32" (echo "Building 32-bit version") ^
 | 
			
		||||
if "%TARGETARCH%"=="386" (echo "Building 32-bit version") ^
 | 
			
		||||
else (echo "Building 64-bit version")
 | 
			
		||||
 | 
			
		||||
#Check residency of workdir
 | 
			
		||||
cd C:
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
#Prepare build dir
 | 
			
		||||
#rmdir /S /Q jcef_build
 | 
			
		||||
mkdir jcef_build && cd jcef_build
 | 
			
		||||
 | 
			
		||||
#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")
 | 
			
		||||
 | 
			
		||||
#Perform build
 | 
			
		||||
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
 | 
			
		||||
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..
 | 
			
		||||
ninja
 | 
			
		||||
 | 
			
		||||
#Compile java classes
 | 
			
		||||
cd ../tools
 | 
			
		||||
if "%1"=="32" (compile.bat win32) else (compile.bat win64)
 | 
			
		||||
if "%TARGETARCH%"=="386" (compile.bat win32) else (compile.bat win64)
 | 
			
		||||
 | 
			
		||||
#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 *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user