This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
jbr-linux-x64 #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: jbr-linux-x64 | |
on: | |
workflow_dispatch: | |
inputs: | |
release_id: | |
required: true | |
default: 'latest' | |
type: string | |
description: "Release id or tag" | |
jbr_branch: | |
required: false | |
type: string | |
description: "JBR branch" | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v3 | |
- name: Generate Variables | |
id: vars | |
run: | | |
release_id='${{ github.event.inputs.release_id }}' | |
if [[ -z "$release_id" ]]; then | |
release_id=latest | |
elif [[ "$release_id" != latest && "$release_id" != tags/* ]]; then | |
release_id="tags/$release_id" | |
fi | |
curl -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -sfL -m 60 -o /tmp/latest.json "${{ github.api_url }}/repos/JetBrains/JetBrainsRuntime/releases/${release_id}" | |
release_name=$(jq -r .name /tmp/latest.json) | |
echo "Release: $release_name" | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
html_url=$(jq -r .html_url /tmp/latest.json) | |
echo "Release URL: $html_url" | |
echo "release_body=$html_url" >> $GITHUB_OUTPUT | |
tag_name=$(jq -r .tag_name /tmp/latest.json) | |
echo "Tag: $tag_name" | |
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT | |
if [[ "$tag_name" == jbr17* ]]; then | |
JBSDK_VERSION=$(sed -E 's/^jbr([0-9_.]+)b.*$/\1/' <<< "$tag_name") | |
build_number=$(sed -E 's/^jbr[0-9_.]+b([0-9.]+)$/\1/' <<< "$tag_name") | |
elif [[ "$tag_name" == jbr-release-17.* ]]; then | |
JBSDK_VERSION=$(sed -E 's/^jbr-release-([0-9_.]+)b.*$/\1/' <<< "$tag_name") | |
build_number=$(sed -E 's/^jbr-release-[0-9_.]+b([0-9.]+)$/\1/' <<< "$tag_name") | |
else | |
echo unknown tag name: $tag_name | |
exit 1 | |
fi | |
echo "JBSDK Version: $JBSDK_VERSION" | |
echo "JBSDK_VERSION=$JBSDK_VERSION" >> $GITHUB_OUTPUT | |
echo "Build Number: $build_number" | |
echo "build_number=$build_number" >> $GITHUB_OUTPUT | |
ref='${{ github.event.inputs.jbr_branch }}' | |
if [[ -z "$ref" ]]; then | |
ref="jb${JBSDK_VERSION}-b${build_number}" | |
fi | |
echo "Ref: $ref" | |
echo "ref=$ref" >> $GITHUB_OUTPUT | |
- name: Init Build Dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update -y | |
sudo rm -f /var/lib/man-db/auto-update | |
echo update_initramfs=no | sudo tee /etc/initramfs-tools/update-initramfs.conf | |
sudo apt-get install -y libasound2-dev libavcodec-dev libavformat-dev libcups2-dev libgl1-mesa-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev libgtk-3-dev libudev-dev libxrandr-dev libxslt1-dev libxtst-dev libxxf86vm-dev x11proto-xf86vidmode-dev | |
sudo apt-get clean -y | |
- name: Prepare JCEF | |
run: | | |
aria2c -x 5 -o jbrsdk_jcef.tgz 'https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_jcef-${{ steps.vars.outputs.JBSDK_VERSION }}-linux-x64-b${{ steps.vars.outputs.build_number }}.tar.gz' | |
mkdir jcef_linux_x64 | |
cd jcef_linux_x64 | |
tar -zxvf ../jbrsdk_jcef.tgz --strip-components=1 -C ./ --wildcards -- 'jbrsdk_jcef-*/jmods/gluegen.rt.jmod' 'jbrsdk_jcef-*/jmods/jogl.all.jmod' 'jbrsdk_jcef-*/jmods/jcef.jmod' 'jbrsdk_jcef-*/release' | |
grep '^JCEF_VERSION' release > jcef.version || cat release | |
rm -f ../jbrsdk_jcef.tgz | |
- name: Clone JBR Repository | |
uses: actions/checkout@v3 | |
with: | |
repository: JetBrains/JetBrainsRuntime | |
ref: ${{ steps.vars.outputs.ref }} | |
fetch-depth: 0 # 这里必须拉取全部历史,下面的mkimages_x64.sh里面会通过git log找tag | |
path: JetBrainsRuntime | |
- name: Patch & Compile JetBrainsRuntime with JCEF | |
id: compile | |
run: | | |
cd JetBrainsRuntime | |
git log -1 | |
patch -p1 < ../idea.patch | |
mv ../jcef_linux_x64 ./ | |
export BOOT_JDK="$JAVA_HOME_17_X64" | |
jb/project/tools/linux/scripts/mkimages_x64.sh '${{ steps.vars.outputs.build_number }}' jcef | |
echo "jbr_image=$(ls -1 jbr_jcef-*-linux-x64-*.tar.gz)" >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.vars.outputs.tag_name }} | |
name: ${{ steps.vars.outputs.release_name }} | |
body: ${{ steps.vars.outputs.release_body }} | |
draft: false | |
prerelease: true | |
files: JetBrainsRuntime/${{ steps.compile.outputs.jbr_image }} |