mirror of
https://github.com/jcefmaven/jcefbuild.git
synced 2025-09-23 15:46:37 +08:00
Add dispatchable workflow
This commit is contained in:
parent
e42c8126b8
commit
bf5b6851c5
58
.github/workflows/build.yml
vendored
Normal file
58
.github/workflows/build.yml
vendored
Normal file
@ -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
|
||||||
|
|
@ -6,6 +6,9 @@ ARG BUILD_TYPE
|
|||||||
#Declare architecture argument (386 or amd64)
|
#Declare architecture argument (386 or amd64)
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
#Declare git ref
|
||||||
|
ARG REF
|
||||||
|
|
||||||
WORKDIR /builder
|
WORKDIR /builder
|
||||||
#Copy existing sources, if any
|
#Copy existing sources, if any
|
||||||
COPY jcef /jcef
|
COPY jcef /jcef
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! $# -eq 2 ]
|
if [ $# -lt 2 ]
|
||||||
then
|
then
|
||||||
echo "Usage: ./compile_linux.sh <architecture> <buildType>"
|
echo "Usage: ./compile_linux.sh <architecture> <buildType> [ref]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "architecture: the target architecture to build for. Architectures are either 386 or amd64."
|
echo "architecture: the target architecture to build for. Architectures are either 386 or amd64."
|
||||||
echo "buildType: either Release or Debug"
|
echo "buildType: either Release or Debug"
|
||||||
|
echo "ref: the git commit id to pull"
|
||||||
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 --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
|
||||||
|
@ -8,13 +8,13 @@ if [ ! -f "/jcef/README.md" ]; then
|
|||||||
echo "Did not find existing files to build - cloning..."
|
echo "Did not find existing files to build - cloning..."
|
||||||
rm -rf /jcef
|
rm -rf /jcef
|
||||||
git clone https://bitbucket.org/chromiumembedded/java-cef.git /jcef
|
git clone https://bitbucket.org/chromiumembedded/java-cef.git /jcef
|
||||||
|
cd /jcef
|
||||||
|
git checkout ${REF}
|
||||||
else
|
else
|
||||||
echo "Found existing files to build"
|
echo "Found existing files to build"
|
||||||
|
cd /jcef
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enter the JCEF source code directory.
|
|
||||||
cd /jcef
|
|
||||||
|
|
||||||
# Create and enter the `jcef_build` directory.
|
# Create and enter the `jcef_build` directory.
|
||||||
# The `jcef_build` directory name is required by other JCEF tooling
|
# The `jcef_build` directory name is required by other JCEF tooling
|
||||||
# and should not be changed.
|
# and should not be changed.
|
||||||
|
Loading…
Reference in New Issue
Block a user