Skip to content

Commit

Permalink
Install ICU from package repositories in CI
Browse files Browse the repository at this point in the history
Ubuntu 24.04 provides a new-enough version of ICU to be accepted by the libloot build.
  • Loading branch information
Ortham committed Jan 13, 2025
1 parent fe710c2 commit b647914
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
runs-on: ubuntu-24.04

env:
ICU_MAJOR_VERSION: 71
LIBLOOT_VERSION: 0.24.5

steps:
Expand All @@ -31,8 +30,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.LIBLOOT_INSTALL_PATH }}
# Key includes ICU major version because libloot links against it as a shared library.
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}-icu-${{ env.ICU_MAJOR_VERSION }}
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}

- name: Get descriptive version
id: get-version
Expand All @@ -49,17 +47,9 @@ jobs:
sudo apt-get install -y --no-upgrade \
cbindgen \
libboost-dev \
libicu-dev \
libtbb-dev
- name: Get ICU
id: get-icu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR_VERSION}-1/icu4c-${ICU_MAJOR_VERSION}_1-Ubuntu20.04-x64.tgz
tar -xf icu4c-${ICU_MAJOR_VERSION}_1-Ubuntu20.04-x64.tgz
ICU_INSTALL_PATH="${{ github.workspace }}/icu/usr/local"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ICU_INSTALL_PATH/lib" >> "$GITHUB_ENV"
echo "root=$ICU_INSTALL_PATH" >> $GITHUB_OUTPUT
- name: Download and build libloot
run: |
wget https://github.com/loot/libloot/archive/$LIBLOOT_VERSION.tar.gz
Expand All @@ -68,7 +58,7 @@ jobs:
mkdir libloot-$LIBLOOT_VERSION/build
cd libloot-$LIBLOOT_VERSION/build
cmake .. -DICU_ROOT="${{ steps.get-icu.outputs.root }}" -DLIBLOOT_BUILD_TESTS=OFF -DLIBLOOT_INSTALL_DOCS=OFF -DCMAKE_INSTALL_PREFIX="$LIBLOOT_INSTALL_PATH"
cmake .. -DLIBLOOT_BUILD_TESTS=OFF -DLIBLOOT_INSTALL_DOCS=OFF -DCMAKE_INSTALL_PREFIX="$LIBLOOT_INSTALL_PATH"
cmake --build . --target loot --config Release
cmake --install . --config Release
Expand All @@ -78,7 +68,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DICU_ROOT="${{ steps.get-icu.outputs.root }}" -DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }}" -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
cmake .. -DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }}" -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
make all
- name: Build archive
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
needs: create_release

env:
ICU_MAJOR_VERSION: 71
LIBLOOT_VERSION: 0.24.5

steps:
Expand All @@ -52,8 +51,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.LIBLOOT_INSTALL_PATH }}
# Key includes ICU major version because libloot links against it as a shared library.
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}-icu-${{ env.ICU_MAJOR_VERSION }}
key: ${{ runner.os }}-libloot-${{ env.LIBLOOT_VERSION }}

- name: Get descriptive version
id: get-version
Expand All @@ -70,17 +68,9 @@ jobs:
sudo apt-get install -y --no-upgrade \
cbindgen \
libboost-dev \
libicu-dev \
libtbb-dev
- name: Get ICU
id: get-icu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR_VERSION}-1/icu4c-${ICU_MAJOR_VERSION}_1-Ubuntu20.04-x64.tgz
tar -xf icu4c-${ICU_MAJOR_VERSION}_1-Ubuntu20.04-x64.tgz
ICU_INSTALL_PATH="${{ github.workspace }}/icu/usr/local"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ICU_INSTALL_PATH/lib" >> "$GITHUB_ENV"
echo "root=$ICU_INSTALL_PATH" >> $GITHUB_OUTPUT
- name: Download and build libloot
run: |
wget https://github.com/loot/libloot/archive/$LIBLOOT_VERSION.tar.gz
Expand All @@ -89,7 +79,7 @@ jobs:
mkdir libloot-$LIBLOOT_VERSION/build
cd libloot-$LIBLOOT_VERSION/build
cmake .. -DICU_ROOT="${{ steps.get-icu.outputs.root }}" -DLIBLOOT_BUILD_TESTS=OFF -DLIBLOOT_INSTALL_DOCS=OFF -DCMAKE_INSTALL_PREFIX="$LIBLOOT_INSTALL_PATH"
cmake .. -DLIBLOOT_BUILD_TESTS=OFF -DLIBLOOT_INSTALL_DOCS=OFF -DCMAKE_INSTALL_PREFIX="$LIBLOOT_INSTALL_PATH"
cmake --build . --target loot --config Release
cmake --install . --config Release
Expand All @@ -99,7 +89,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DICU_ROOT="${{ steps.get-icu.outputs.root }}" -DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }}" -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
cmake .. -DCMAKE_PREFIX_PATH="${{ env.LIBLOOT_INSTALL_PATH }}" -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
make all
- name: Build archive
Expand Down

0 comments on commit b647914

Please sign in to comment.