Bump actions/download-artifact from 6 to 7 #21
Workflow file for this run
This file contains hidden or 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: Build native dependencies (FreeType) | |
| # Change target FreeType version based on https://github.com/freetype/freetype/tags. | |
| env: | |
| FREETYPE_VERSION: VER-2-14-1 # Make sure this matches the version mentioned in the description in the .nuspec file. | |
| on: | |
| pull_request: | |
| workflow_call: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| windows: | |
| name: Windows (x86 + x64) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Dependencies | |
| run: | | |
| mkdir -p artifacts/x86 | |
| mkdir artifacts/x64 | |
| sudo apt-get install mingw-w64 | |
| - name: Compile natives | |
| run: | | |
| curl -s -L -O https://github.com/freetype/freetype/archive/refs/tags/${FREETYPE_VERSION}.zip | |
| unzip ${FREETYPE_VERSION}.zip | |
| mkdir freetype-${FREETYPE_VERSION}/build | |
| cd freetype-${FREETYPE_VERSION} | |
| patch -p0 < ../win64.patch | |
| cd build | |
| cmake .. -DCMAKE_TOOLCHAIN_FILE=../../mingw-x86.cmake -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE -DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc" | |
| cmake --build . | |
| cp libfreetype.dll ../../artifacts/x86/freetype6.dll | |
| rm -rf * | |
| cmake .. -DCMAKE_TOOLCHAIN_FILE=../../mingw-x64.cmake -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE | |
| cmake --build . | |
| cp libfreetype.dll ../../artifacts/x64/freetype6.dll | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Natives-Windows | |
| path: ./artifacts | |
| macos: | |
| name: macOS (x64 + arm64) | |
| runs-on: macos-13 | |
| steps: | |
| - name: Setup Dependencies | |
| run: | | |
| mkdir -p artifacts/x86_64 | |
| mkdir artifacts/arm64 | |
| - name: Compile natives | |
| run: | | |
| curl -s -L -O https://github.com/freetype/freetype/archive/refs/tags/${FREETYPE_VERSION}.zip | |
| unzip ${FREETYPE_VERSION}.zip | |
| cd freetype-${FREETYPE_VERSION} | |
| cmake -B build -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE | |
| cmake --build build | |
| lipo -thin x86_64 build/libfreetype.6.dylib -output ../artifacts/x86_64/freetype6.dylib | |
| lipo -thin arm64 build/libfreetype.6.dylib -output ../artifacts/arm64/freetype6.dylib | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Natives-MacOS | |
| path: ./artifacts | |
| # Note: Running inside a Rocky Linux container because we want to compile using a version of glibc | |
| # that is as old as reasonably possible to ensure backwards compatibility of the compiled binaries. | |
| linux-x64: | |
| name: Linux (x64) | |
| runs-on: ubuntu-22.04 | |
| container: rockylinux:8 | |
| steps: | |
| - name: Setup Dependencies | |
| run: | | |
| mkdir -p artifacts/x64 | |
| dnf install -y "dnf-command(config-manager)" | |
| dnf config-manager --set-enabled powertools | |
| dnf install -y epel-release cmake | |
| dnf groupinstall -y "Development Tools" | |
| dnf -y update | |
| - name: Compile natives | |
| run: | | |
| curl -s -L -O https://github.com/freetype/freetype/archive/refs/tags/${FREETYPE_VERSION}.zip | |
| unzip ${FREETYPE_VERSION}.zip | |
| mkdir freetype-${FREETYPE_VERSION}/build | |
| cd freetype-${FREETYPE_VERSION}/build | |
| cmake .. -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE | |
| cmake --build . | |
| cp libfreetype.so ../../artifacts/x64/freetype6.so | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Natives-Linux(x64) | |
| path: ./artifacts | |
| linux-arm64: | |
| name: Linux (arm64) | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - name: Setup Dependencies | |
| run: | | |
| mkdir -p artifacts/arm64 | |
| sudo apt-get install -y build-essential curl cmake unzip | |
| - name: Compile Natives | |
| run: | | |
| curl -s -L -O https://github.com/freetype/freetype/archive/refs/tags/${FREETYPE_VERSION}.zip | |
| unzip ${FREETYPE_VERSION}.zip | |
| mkdir freetype-${FREETYPE_VERSION}/build | |
| cd freetype-${FREETYPE_VERSION}/build | |
| cmake .. -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE | |
| cmake --build . | |
| cp libfreetype.so ../../artifacts/arm64/freetype6.so | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Natives-Linux(arm64) | |
| path: ./artifacts |