Skip to content

Commit

Permalink
Codechange: [CI] Use runner vcpkg in release-linux workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Nov 29, 2023
1 parent 82ceba3 commit ed5aa3c
Showing 1 changed file with 29 additions and 36 deletions.
65 changes: 29 additions & 36 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
# manylinux2014 is based on CentOS 7, but already has a lot of things
# installed and preconfigured. It makes it easier to build OpenTTD.
image: quay.io/pypa/manylinux2014_x86_64
volumes:
- /usr/local/share/vcpkg:/vcpkg
env:
ImageOS: ${{ env.ImageOS }}
ImageVersion: ${{ env.ImageVersion }}

steps:
- name: Download source
Expand All @@ -41,13 +46,18 @@ jobs:
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2

- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /vcpkg/installed
key: ubuntu-20.04-vcpkg-release-1 # Increase the number whenever dependencies are modified
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
ubuntu-20.04-vcpkg-release
${{ steps.key.outputs.image }}-vcpkg-release
- name: Install dependencies
run: |
Expand Down Expand Up @@ -103,40 +113,23 @@ jobs:
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
# We do a little dance to make sure we copy the cached install folder
# into our new clone.
git clone --depth=1 https://github.com/microsoft/vcpkg /vcpkg-clone
if [ -e /vcpkg/installed ]; then
mv /vcpkg/installed /vcpkg-clone/
rm -rf /vcpkg
fi
mv /vcpkg-clone /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
# Once installed (and cached) a package will never be upgraded unless we do it ourselves.
./vcpkg upgrade --no-dry-run
# Make Python3 available for other packages.
./vcpkg install python3
ln -sf $(pwd)/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
./vcpkg install \
breakpad \
curl[http2] \
fontconfig \
freetype \
harfbuzz \
icu \
liblzma \
libpng \
lzo \
sdl2 \
zlib \
# EOF
)
# Make Python3 available for other packages.
/vcpkg/vcpkg install python3
ln -sf /vcpkg/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
/vcpkg/vcpkg install \
breakpad \
curl[http2] \
fontconfig \
freetype \
harfbuzz \
icu \
liblzma \
libpng \
lzo \
sdl2 \
zlib \
# EOF
echo "::endgroup::"
echo "::group::Install breakpad dependencies"
Expand Down

0 comments on commit ed5aa3c

Please sign in to comment.