|
| 1 | +name: Docker Build cefbrowser |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + arch: |
| 7 | + description: "Architecure" |
| 8 | + default: arm64 |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + arch_build: |
| 12 | + description: "Create Release" |
| 13 | + default: arm64 |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + compiler: |
| 17 | + description: "Compiler" |
| 18 | + default: aarch64-linux-gnu |
| 19 | + required: true |
| 20 | + type: string |
| 21 | + compiler_version: |
| 22 | + description: "Compiler Version" |
| 23 | + default: 11 |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + ubuntu_version: |
| 27 | + description: "Ubuntu Version" |
| 28 | + default: 22.04 |
| 29 | + required: true |
| 30 | + type: string |
| 31 | + ubuntu_name: |
| 32 | + description: "Ubuntu Name" |
| 33 | + default: jammy |
| 34 | + required: true |
| 35 | + type: string |
| 36 | + |
| 37 | +permissions: write-all |
| 38 | + |
| 39 | +jobs: |
| 40 | + build: |
| 41 | + runs-on: ubuntu-22.04 |
| 42 | + container: |
| 43 | + image: ubuntu:${{ inputs.ubuntu_version }} |
| 44 | + defaults: |
| 45 | + run: |
| 46 | + shell: bash |
| 47 | + steps: |
| 48 | + - name: Install build |
| 49 | + run: | |
| 50 | + export DEBIAN_FRONTEND=noninteractive |
| 51 | + apt update |
| 52 | + apt install -y git make curl pip ninja-build apt-utils pkg-config build-essential |
| 53 | + pip3 install --user cmake |
| 54 | + pip3 install --user "meson==0.63" |
| 55 | +
|
| 56 | + - name: Install Cross-Compile Support |
| 57 | + run: | |
| 58 | + dpkg --add-architecture ${{ inputs.arch }} |
| 59 | + bash -c "echo -e '\ |
| 60 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }} main restricted \n\ |
| 61 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }}-updates main restricted \n\ |
| 62 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }} universe \n\ |
| 63 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }}-updates universe \n\ |
| 64 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }} multiverse \n\ |
| 65 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }}-updates multiverse \n\ |
| 66 | + deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ ${{ inputs.ubuntu_name }}-backports main restricted universe multiverse \n' > /etc/apt/sources.list.d/${{ inputs.arch }}-cross-compile-sources.list"; |
| 67 | + apt update || true |
| 68 | + apt install -y libstdc++6-${{ inputs.arch }}-cross libc6-dev-${{ inputs.arch }}-cross libc6-dev:${{ inputs.arch }} linux-libc-dev-${{ inputs.arch }}-cross linux-libc-dev:${{ inputs.arch }} |
| 69 | + apt install -y gcc-${{ inputs.compiler_version }}-${{ inputs.compiler }} g++-${{ inputs.compiler_version }}-${{ inputs.compiler }} libstdc++-${{ inputs.compiler_version }}-dev-${{ inputs.arch }}-cross libstdc++-${{ inputs.compiler_version }}-dev:${{ inputs.arch }} |
| 70 | +
|
| 71 | + - name: Set Cross-Compile Links |
| 72 | + run: | |
| 73 | + cd /usr/bin |
| 74 | + ln -s ${{ inputs.compiler }}-gcc-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcc || true |
| 75 | + ln -s ${{ inputs.compiler }}-g++-${{ inputs.compiler_version }} ${{ inputs.compiler }}-g++ || true |
| 76 | + ln -s ${{ inputs.compiler }}-gcc-ar-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcc-ar || true |
| 77 | + ln -s ${{ inputs.compiler }}-gcc-nm-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcc-nm || true |
| 78 | + ln -s ${{ inputs.compiler }}-gcov-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcov || true |
| 79 | + ln -s ${{ inputs.compiler }}-gcov-dump-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcov-dump || true |
| 80 | + ln -s ${{ inputs.compiler }}-gcov-tool-${{ inputs.compiler_version }} ${{ inputs.compiler }}-gcov-tool || true |
| 81 | + ln -s ${{ inputs.compiler }}-ld.bfd ${{ inputs.compiler }}-ld || true |
| 82 | + ln -s /usr/share/pkg-config-crosswrapper /usr/bin/${{ inputs.compiler }}-pkg-config || true |
| 83 | +
|
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + apt install -y zlib1g-dev:${{ inputs.arch }} libssl-dev:${{ inputs.arch }} libcrypt-dev:${{ inputs.arch }} libglib2.0-dev:${{ inputs.arch }} \ |
| 87 | + libnss3-dev:${{ inputs.arch }} libatk1.0-dev:${{ inputs.arch }} libatk-bridge2.0-dev:${{ inputs.arch }} libcups2-dev:${{ inputs.arch }} \ |
| 88 | + libxcomposite-dev:${{ inputs.arch }} libxdamage-dev:${{ inputs.arch }} libxrandr-dev:${{ inputs.arch }} libgbm-dev:${{ inputs.arch }} \ |
| 89 | + libxkbcommon-dev:${{ inputs.arch }} libpango1.0-dev:${{ inputs.arch }} libasound2-dev:${{ inputs.arch }} |
| 90 | +
|
| 91 | + - name: Checkout |
| 92 | + run: | |
| 93 | + git clone --depth 1 https://github.com/Zabrimus/cefbrowser.git |
| 94 | +
|
| 95 | + - name: build |
| 96 | + shell: bash |
| 97 | + run: | |
| 98 | + export PATH=~/.local/bin/:$PATH |
| 99 | + cd cefbrowser |
| 100 | + ./setup.sh ${{ inputs.arch_build }} |
| 101 | + PKG_CONFIG_PATH=/usr/lib/${{ inputs.compiler }}/pkgconfig meson setup build --cross-file xcompile/meson-cross-file-debian-${{ inputs.arch_build }}.conf -Darch=${{ inputs.arch_build }} -Dstrip=true |
| 102 | + echo "cd into build directory" |
| 103 | + cd build |
| 104 | + meson compile |
| 105 | + meson install --skip-subprojects |
| 106 | + CREV=$(cd .. && git rev-parse --short HEAD) |
| 107 | + echo "VERSION=$CREV" >> Release/VERSION |
| 108 | + |
| 109 | + if [ "${{ inputs.ubuntu_version }}" = "20.04" ]; then |
| 110 | + OPENSSL_VERSION=1 |
| 111 | + else |
| 112 | + OPENSSL_VERSION=3 |
| 113 | + fi |
| 114 | + |
| 115 | + echo "FILENAME=cefbrowser-${{ inputs.arch }}-openssl-${OPENSSL_VERSION}-${CREV}" >> $GITHUB_ENV |
| 116 | + |
| 117 | + mv Release cefbrowser-${{ inputs.arch }}-openssl-${OPENSSL_VERSION}-${CREV} |
| 118 | + tar -czf cefbrowser-${{ inputs.arch }}-openssl-${OPENSSL_VERSION}-${CREV}.tar.gz cefbrowser-${{ inputs.arch }}-openssl-${OPENSSL_VERSION}-${CREV} |
| 119 | + ls -la |
| 120 | +
|
| 121 | + - name: Get current date |
| 122 | + id: date |
| 123 | + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" |
| 124 | + |
| 125 | + - uses: oprypin/find-latest-tag@v1 |
| 126 | + with: |
| 127 | + repository: Zabrimus/cefbrowser |
| 128 | + releases-only: false |
| 129 | + id: current_release_tag |
| 130 | + |
| 131 | + - name: Release |
| 132 | + run: | |
| 133 | + TAG="${{ steps.date.outputs.date }}" |
| 134 | + |
| 135 | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg |
| 136 | + chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg |
| 137 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null |
| 138 | + apt update || true |
| 139 | + apt install gh -y |
| 140 | + |
| 141 | + cd cefbrowser/build |
| 142 | + gh release create "$TAG" -R Zabrimus/cefbrowser || true |
| 143 | + gh release upload "$TAG" cefbrowser*.tar.gz --clobber -R Zabrimus/cefbrowser |
| 144 | + env: |
| 145 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments