mirror of
https://github.com/jcefmaven/jcefbuild.git
synced 2025-09-18 13:26:38 +08:00
Begin release process
This commit is contained in:
parent
bf5b6851c5
commit
c30360828d
48
.github/workflows/build.yml
vendored
48
.github/workflows/build.yml
vendored
@ -3,14 +3,55 @@ name: build
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
repo:
|
||||||
|
description: 'Git repository to clone'
|
||||||
|
required: true
|
||||||
|
default: 'https://bitbucket.org/chromiumembedded/java-cef.git'
|
||||||
ref:
|
ref:
|
||||||
description: 'Git commit id to checkout'
|
description: 'Git commit id to checkout'
|
||||||
required: false
|
required: true
|
||||||
default: 'master'
|
default: 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Generate release info
|
||||||
|
run: |
|
||||||
|
chmod +x tools/create_release_info.sh
|
||||||
|
./create_release_info.sh ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} ${{github.run_number}}
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: ${{env.release_name}}
|
||||||
|
tag_name: ${{env.release_tag_name}}
|
||||||
|
body_path: tools/release_message.md
|
||||||
|
- name: Add LICENSE
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||||
|
asset_path: tools/LICENSE.txt
|
||||||
|
asset_name: LICENSE
|
||||||
|
asset_content_type: text/plain
|
||||||
|
- name: Add build_meta.json
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||||
|
asset_path: tools/build_meta.json
|
||||||
|
asset_name: build_meta.json
|
||||||
|
asset_content_type: application/json
|
||||||
|
|
||||||
|
|
||||||
linux-amd64:
|
linux-amd64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: create-release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
@ -24,7 +65,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
run: |
|
run: |
|
||||||
chmod +x compile_linux.sh
|
chmod +x compile_linux.sh
|
||||||
./compile_linux.sh amd64 Release ${{ github.event.inputs.ref }}
|
./compile_linux.sh amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
|
||||||
-
|
-
|
||||||
name: Export artifacts
|
name: Export artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
@ -35,6 +76,7 @@ jobs:
|
|||||||
|
|
||||||
linux-i386:
|
linux-i386:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: create-release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
@ -48,7 +90,7 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
run: |
|
run: |
|
||||||
chmod +x compile_linux.sh
|
chmod +x compile_linux.sh
|
||||||
./compile_linux.sh 386 Release ${{ github.event.inputs.ref }}
|
./compile_linux.sh 386 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
|
||||||
-
|
-
|
||||||
name: Export artifacts
|
name: Export artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
out
|
out
|
||||||
|
tools/*.txt
|
||||||
|
tools/*.md
|
||||||
|
tools/*.json
|
||||||
|
@ -6,7 +6,8 @@ ARG BUILD_TYPE
|
|||||||
#Declare architecture argument (386 or amd64)
|
#Declare architecture argument (386 or amd64)
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
#Declare git ref
|
#Declare git args
|
||||||
|
ARG REPO
|
||||||
ARG REF
|
ARG REF
|
||||||
|
|
||||||
WORKDIR /builder
|
WORKDIR /builder
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ $# -lt 2 ]
|
if [ $# -lt 2 ] || [ $# -eq 3 ]
|
||||||
then
|
then
|
||||||
echo "Usage: ./compile_linux.sh <architecture> <buildType> [ref]"
|
echo "Usage: ./compile_linux.sh <architecture> <buildType> [<gitrepo> <gitref>]"
|
||||||
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"
|
echo "gitrepo: git repository url to clone"
|
||||||
|
echo "gitref: 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
|
||||||
if [ $# -eq 2 ]
|
if [ $# -eq 2 ]
|
||||||
then
|
then
|
||||||
docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REF=master --file DockerfileLinux --output out .
|
docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REPO=https://bitbucket.org/chromiumembedded/java-cef.git --build-arg REF=master --file DockerfileLinux --output out .
|
||||||
else
|
else
|
||||||
docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REF=$3 --file DockerfileLinux --output out .
|
docker buildx build --platform=linux/$1 --build-arg TARGETARCH=$1 --build-arg BUILD_TYPE=$2 --build-arg REPO=$3 --build-arg REF=$4 --file DockerfileLinux --output out .
|
||||||
fi
|
fi
|
||||||
|
@ -7,7 +7,7 @@ echo "Building for architecture $TARGETARCH"
|
|||||||
if [ ! -f "/jcef/README.md" ]; then
|
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 ${REPO} /jcef
|
||||||
cd /jcef
|
cd /jcef
|
||||||
git checkout ${REF}
|
git checkout ${REF}
|
||||||
else
|
else
|
||||||
|
80
tools/create_release_info.sh
Executable file
80
tools/create_release_info.sh
Executable file
@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! $# -eq 4 ]
|
||||||
|
then
|
||||||
|
echo "Usage: ./create_release_info.sh <gitrepo> <gitref> <actionsurl> <actionsrunnumber>"
|
||||||
|
echo ""
|
||||||
|
echo "gitrepo: git repository url to clone"
|
||||||
|
echo "gitref: the git commit id to pull"
|
||||||
|
echo "actionsurl: the url pointing to the builder job"
|
||||||
|
echo "actionsrunnumber: the number of the current build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Pull from git
|
||||||
|
git clone $1 jcef
|
||||||
|
cd jcef
|
||||||
|
git checkout $2
|
||||||
|
|
||||||
|
#Dump git commit id and suspected url
|
||||||
|
git rev-parse HEAD | cut -c -7 > ../commit_id.txt #Use short 7-digit commit id
|
||||||
|
(
|
||||||
|
sed 's/\.git.*$//' <<< "$1" #Remove .git and everything behind from url
|
||||||
|
echo "/commits/"
|
||||||
|
git rev-parse HEAD #Add commit id
|
||||||
|
) | awk '{print}' ORS='' > ../commit_url.txt #Remove newlines and pipe to file
|
||||||
|
|
||||||
|
#Dump git commit message
|
||||||
|
git log -1 --pretty=%B > ../commit_message.txt
|
||||||
|
|
||||||
|
#Dump cef version info
|
||||||
|
(grep -o -P '(?<=CEF_VERSION \").*(?=\")' < CMakeLists.txt) > ../cef_version.txt
|
||||||
|
|
||||||
|
#Build final release information
|
||||||
|
#Tag
|
||||||
|
(
|
||||||
|
echo "release_tag_name="
|
||||||
|
echo "jcef-"
|
||||||
|
cat ../commit_id.txt
|
||||||
|
echo "+cef-"
|
||||||
|
cat ../cef_version.txt
|
||||||
|
) | awk '{print}' ORS='' >> $GITHUB_ENV
|
||||||
|
|
||||||
|
#Name
|
||||||
|
(
|
||||||
|
echo "release_name="
|
||||||
|
echo "JCEF "
|
||||||
|
cat ../commit_id.txt
|
||||||
|
echo " + CEF "
|
||||||
|
cat ../cef_version.txt
|
||||||
|
) | awk '{print}' ORS='' >> $GITHUB_ENV
|
||||||
|
|
||||||
|
#Readme
|
||||||
|
(
|
||||||
|
echo "Update JCEF to ["
|
||||||
|
cat ../commit_id.txt
|
||||||
|
echo "]("
|
||||||
|
cat ../commit_url.txt
|
||||||
|
echo ")"
|
||||||
|
echo ""
|
||||||
|
echo "Build: [GitHub Actions #$4]($3)"
|
||||||
|
echo ""
|
||||||
|
echo "JCEF version:"
|
||||||
|
cat ../commit_id.txt
|
||||||
|
echo ""
|
||||||
|
echo "CEF version:"
|
||||||
|
cat ../cef_version.txt
|
||||||
|
echo ""
|
||||||
|
echo "Changes from previous release:"
|
||||||
|
echo "\`\`\`"
|
||||||
|
cat ../commit_message.txt
|
||||||
|
echo "\`\`\`"
|
||||||
|
) > ../release_message.md
|
||||||
|
|
||||||
|
#Add LICENSE
|
||||||
|
mv LICENSE.txt ..
|
||||||
|
|
||||||
|
#Cleanup
|
||||||
|
rm *.txt
|
||||||
|
cd ..
|
||||||
|
rm -rf jcef
|
Loading…
Reference in New Issue
Block a user