Updating LZ4 #10
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: CI/CD | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master ] | |
create: null | |
env: | |
debianRequirements: "build-essential git zlib1g-dev liblz4-dev cmake qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools qt6-declarative-dev qt6-base-dev qt6-base-dev-tools qt6-translations-l10n libqt6opengl6-dev libgl1-mesa-dev wget curl devscripts" | |
jobs: | |
main_build: | |
name: ${{ matrix.package_suffix }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
qt: | |
- 6.6.2 | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
build_type: | |
- Release | |
include: | |
- qt_tools: tools_ninja | |
qt_modules: | |
cmake_cli_arg: 'OFF' | |
- os: ubuntu-latest | |
package_extension: 'tar.xz' | |
package_suffix: 'linux64' | |
cmake_extra_args: '-Dlz4_DIR=C:/lz4/lib/cmake/lz4' | |
- os: macos-latest | |
package_extension: 'dmg' | |
package_suffix: 'macos' | |
cmake_extra_args: "-DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\"" | |
- os: windows-latest | |
package_extension: 'zip' | |
package_suffix: 'win64' | |
win_arch: "x64" | |
qt_arch: win64_msvc2019_64 | |
cmake_extra_args: '-DZLIB_ROOT=C:/zlib -Dlz4_DIR=C:/lz4/lib/cmake/lz4' | |
qt_tools: tools_ninja, tools_cmake | |
env: | |
qt_installation_path: ${{ github.workspace }} | |
zlib_path: ${{ github.workspace }}/../zlib-git | |
zlib_build_path: ${{ github.workspace }}/../build-zlib-git | |
zlib_installation_path: C:/zlib | |
zlib_version: "1.3.1" | |
lz4_path: ${{ github.workspace }}/../lz4-git | |
lz4_build_path: ${{ github.workspace }}/../build-lz4-git | |
lz4_installation_path: C:/lz4 | |
lz4_version: "1.9.4" | |
deling_build_path: ${{ github.workspace }}/../build-deling | |
deling_installation_path: ${{ github.workspace }}/../installation-deling | |
deling_appbundle_path: ${{ github.workspace }}/../appbundle-deling | |
CMAKE_GENERATOR: Ninja | |
CMAKE_BUILD_TYPE: ${{ matrix.build_type }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Env Script (Windows) | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: runner.os == 'Windows' | |
with: | |
arch: ${{ matrix.win_arch }} | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3.3.0 | |
with: | |
dir: ${{ env.qt_installation_path }} | |
arch: ${{ matrix.qt_arch }} | |
version: ${{ matrix.qt }} | |
cache: true | |
tools: ${{ matrix.qt_tools }} | |
modules: ${{ matrix.qt_modules }} | |
- name: Configure env | |
shell: bash | |
run: | | |
QT_MAJOR_VERSION=$(echo "${{ matrix.qt }}" | sed -E 's/^([0-9]+)\..*/\1/') | |
QT_DIR=$(eval 'echo $Qt'"$QT_MAJOR_VERSION"'_DIR') | |
echo "$IQTA_TOOLS/Ninja" >> $GITHUB_PATH | |
echo "$IQTA_TOOLS/CMake_64/bin" >> $GITHUB_PATH | |
echo "QT_MAJOR_VERSION=$QT_MAJOR_VERSION" >> $GITHUB_ENV | |
echo "QT_DIR=$QT_DIR" >> $GITHUB_ENV | |
- name: Set prerelease string | |
if: github.event.ref_type != 'tag' | |
shell: bash | |
run: | | |
echo "PRERELEASE_STRING= unstable build" >> $GITHUB_ENV | |
- name: Cache Zlib | |
id: cache-zlib | |
if: runner.os == 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.zlib_installation_path }} | |
key: ${{ runner.os }}${{ matrix.win_arch }}-zlib-${{ env.zlib_version}} | |
- name: Install Zlib | |
if: (runner.os == 'Windows') && (steps.cache-zlib.outputs.cache-hit != 'true') | |
run: | | |
git clone -q --depth 1 --single-branch --branch=v${{ env.zlib_version }} https://github.com/madler/zlib ${{ env.zlib_path }} | |
cmake -S${{ env.zlib_path }} -B${{ env.zlib_build_path }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ env.zlib_installation_path }} | |
cmake --build ${{ env.zlib_build_path }} --target install -j3 | |
- name: Install lz4 | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update -qqq -y | |
sudo apt-get install -qqq liblz4-dev | |
- name: Cache lz4 | |
id: cache-lz4 | |
if: runner.os == 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.lz4_installation_path }} | |
key: ${{ runner.os }}${{ matrix.win_arch }}-lz4-${{ env.lz4_version}} | |
- name: Install lz4 Windows | |
if: (runner.os == 'Windows') && (steps.cache-lz4.outputs.cache-hit != 'true') | |
run: | | |
git clone -q --depth 1 --single-branch --branch=v${{ env.lz4_version }} https://github.com/lz4/lz4 ${{ env.lz4_path }} | |
cmake -S${{ env.lz4_path }}/build/cmake -B${{ env.lz4_build_path }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ env.lz4_installation_path }} -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=ON -DLZ4_BUILD_LEGACY_LZ4C:BOOL=OFF -DLZ4_POSITION_INDEPENDENT_LIB:BOOL=OFF -DLZ4_BUILD_CLI:BOOL=OFF | |
cmake --build ${{ env.lz4_build_path }} --target install -j3 | |
ls ${{ env.lz4_installation_path }} | |
ls ${{ env.lz4_installation_path }}/lib/cmake/lz4 | |
cat ${{ env.lz4_installation_path }}/lib/cmake/lz4/lz4Targets.cmake | |
cat ${{ env.lz4_installation_path }}/lib/cmake/lz4/lz4Targets-release.cmake | |
- name: Download linuxdeployqt | |
if: runner.os == 'Linux' | |
run: | | |
wget -qc "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | |
wget -qc "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" | |
export VERSION=continuous | |
chmod a+x linuxdeploy*.AppImage | |
mv linuxdeploy-plugin-qt-*.AppImage $QT_DIR/bin/linuxdeploy-plugin-qt | |
mv linuxdeploy-*.AppImage $QT_DIR/bin/linuxdeploy | |
- name: Build Deling | |
id: main_build | |
run: | | |
cmake -B ${{ env.deling_build_path }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ env.deling_installation_path }} -DPRERELEASE_STRING="$PRERELEASE_STRING" ${{ matrix.cmake_extra_args }} | |
cmake --build ${{ env.deling_build_path }} --target package -j3 | |
- name: Build AppImage (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo add-apt-repository -y universe | |
sudo apt install -y libfuse2 libxkbcommon-x11-0 libxcb-cursor0 | |
cmake --build ${{ env.deling_build_path }} --target install -j3 | |
mkdir -p ${{env.deling_appbundle_path}}/usr/share/deling/translations | |
cp ${{env.deling_installation_path}}/share/deling/translations/*.qm ${{env.deling_appbundle_path}}/usr/share/deling/translations/ | |
export VERSION=continuous | |
export PATH=$PATH:${{ env.qt_installation_path }}/Qt/${{ matrix.qt }}/gcc_64/libexec | |
linuxdeploy --appdir="${{ env.deling_appbundle_path }}" --plugin=qt --output appimage \ | |
-e "${{ env.deling_installation_path }}"/bin/Deling \ | |
-d "${{ env.deling_installation_path }}"/share/applications/io.github.myst6re.deling.desktop \ | |
-i "${{ env.deling_installation_path }}"/share/icons/hicolor/256x256/apps/io.github.myst6re.deling.png | |
mv *.AppImage deling-continuous-${{ matrix.package_suffix }}.AppImage | |
- name: Prepare Upload | |
shell: bash | |
run: mv ../build-deling/*.${{ matrix.package_extension }} deling-continuous-${{ matrix.package_suffix }}.${{ matrix.package_extension }} | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ matrix.package_suffix }} | |
path: ${{ github.workspace }}/deling-continuous-*.* | |
deb_builder: | |
name: debianBuilder-${{matrix.config.name}} | |
runs-on: ${{matrix.config.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: jammy , os: ubuntu-22.04 | |
, debArch: amd64 | |
} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --tags --force | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -y > /dev/null | |
sudo apt-get install -qqq ${{env.debianRequirements}} > /dev/null | |
- name: Build | |
run: | | |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DQT_DEFAULT_MAJOR_VERSION=6 -DCPACK_DEBIAN_PACKAGE_RELEASE=${{github.run_attempt}}~${{matrix.config.name}} | |
cmake --build build | |
cpack -G DEB -C Release --config build/CPackConfig.cmake | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debian-artifacts-${{ matrix.config.name }}} | |
path: deling*.deb | |
pre_release_assets: | |
name: Pre-Release | |
needs: [main_build, deb_builder] | |
if: (github.event.ref_type != 'tag') && (github.ref == 'refs/heads/master') | |
concurrency: pre-release-${{ github.ref }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Files | |
uses: actions/download-artifact@v4 | |
- name: Deploy Package | |
uses: crowbarmaster/GH-Automatic-Releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "continuous" | |
prerelease: true | |
title: "Unstable Build" | |
files: | | |
artifact-*/* | |
debian-artifacts-*/* | |
release_assets: | |
name: Release | |
needs: [main_build, deb_builder] | |
if: github.event.ref_type == 'tag' | |
concurrency: release-${{ github.ref }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Files | |
uses: actions/download-artifact@v4 | |
- name: Prepare Upload | |
shell: bash | |
run: find . -type f -name 'deling-continuous-*' -exec bash -c 'mv "{}" $(echo {} | sed 's/continuous-//')' ';' | |
- name: Deploy Package | |
uses: crowbarmaster/GH-Automatic-Releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
title: ${{ github.event.ref }} | |
files: | | |
artifact-*/* | |
debian-artifacts-*/* | |