diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1be582a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: build + +on: + workflow_dispatch: + inputs: + ref: + description: 'Git commit id to checkout' + required: false + default: 'master' + +jobs: + linux-amd64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Build + run: | + chmod +x compile_linux.sh + ./compile_linux.sh amd64 Release ${{ github.event.inputs.ref }} + - + name: Export artifacts + uses: actions/upload-artifact@v2 + with: + name: linux-amd64.tar.gz + path: out/binary_distrib.tar.gz + + + linux-i386: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Build + run: | + chmod +x compile_linux.sh + ./compile_linux.sh 386 Release ${{ github.event.inputs.ref }} + - + name: Export artifacts + uses: actions/upload-artifact@v2 + with: + name: linux-i386.tar.gz + path: out/binary_distrib.tar.gz + diff --git a/DockerfileLinux b/DockerfileLinux index ff0025c..87ec533 100644 --- a/DockerfileLinux +++ b/DockerfileLinux @@ -6,6 +6,9 @@ ARG BUILD_TYPE #Declare architecture argument (386 or amd64) ARG TARGETARCH +#Declare git ref +ARG REF + WORKDIR /builder #Copy existing sources, if any COPY jcef /jcef diff --git a/compile_linux.sh b/compile_linux.sh index f2ee29f..8833741 100755 --- a/compile_linux.sh +++ b/compile_linux.sh @@ -1,14 +1,19 @@ #!/bin/bash -if [ ! $# -eq 2 ] +if [ $# -lt 2 ] then - echo "Usage: ./compile_linux.sh " + echo "Usage: ./compile_linux.sh [ref]" echo "" echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." echo "buildType: either Release or Debug" + echo "ref: the git commit id to pull" exit 1 fi #Execute buildx with linux dockerfile and output to current directory -docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --file DockerfileLinux --output out . - +if [ $# -eq 2 ] + then + docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REF=master --file DockerfileLinux --output out . +else + docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REF=$3 --file DockerfileLinux --output out . +fi diff --git a/scripts/run_linux.sh b/scripts/run_linux.sh index d59219f..163ad53 100644 --- a/scripts/run_linux.sh +++ b/scripts/run_linux.sh @@ -8,13 +8,13 @@ if [ ! -f "/jcef/README.md" ]; then echo "Did not find existing files to build - cloning..." rm -rf /jcef git clone https://bitbucket.org/chromiumembedded/java-cef.git /jcef + cd /jcef + git checkout ${REF} else echo "Found existing files to build" + cd /jcef fi -# Enter the JCEF source code directory. -cd /jcef - # Create and enter the `jcef_build` directory. # The `jcef_build` directory name is required by other JCEF tooling # and should not be changed.