mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
CI (macOS / Windows): reduces deps; builds universal darwin binary
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
name: Reusable macOS Hosts
|
name: Reusable macOS Universal
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
|
||||||
arch:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
runs-on:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -18,7 +11,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ inputs.runs-on }}
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
@@ -26,40 +19,20 @@ jobs:
|
|||||||
- name: uname -a
|
- name: uname -a
|
||||||
run: uname -a
|
run: uname -a
|
||||||
|
|
||||||
- name: install required packages with MacPorts # Homebrew dropped Intel support
|
|
||||||
if: inputs.arch == 'amd64'
|
|
||||||
run: |
|
|
||||||
# resolve the latest MacPorts release; "15-Sequoia" must keep matching the runner image (macos-15-intel, set in ci.yml)
|
|
||||||
macports_tag=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" \
|
|
||||||
https://api.github.com/repos/macports/macports-base/releases/latest \
|
|
||||||
| sed -n 's/^[[:space:]]*"tag_name": "\(v[0-9][^"]*\)".*/\1/p')
|
|
||||||
macports_version=${macports_tag#v}
|
|
||||||
echo "Installing MacPorts $macports_version"
|
|
||||||
curl -fsSL "https://github.com/macports/macports-base/releases/download/${macports_tag}/MacPorts-${macports_version}-15-Sequoia.pkg" -o "$RUNNER_TEMP/MacPorts.pkg"
|
|
||||||
sudo installer -pkg "$RUNNER_TEMP/MacPorts.pkg" -target /
|
|
||||||
echo /opt/local/bin >> "$GITHUB_PATH"
|
|
||||||
echo /opt/local/sbin >> "$GITHUB_PATH"
|
|
||||||
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
|
|
||||||
sudo port selfupdate
|
|
||||||
sudo port install vulkan-loader vulkan-headers MoltenVK ImageMagick7 chafa lua quickjs-ng jq
|
|
||||||
|
|
||||||
- name: install required packages with Homebrew
|
- name: install required packages with Homebrew
|
||||||
if: inputs.arch == 'aarch64'
|
|
||||||
run: |
|
run: |
|
||||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew update
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew update
|
||||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa lua quickjs-ng jq
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk chafa lua jq
|
||||||
|
|
||||||
- name: configure project
|
- name: configure project
|
||||||
run: |
|
run: cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
||||||
if [ "${{ inputs.arch }}" = "amd64" ]; then
|
|
||||||
export CMAKE_PREFIX_PATH=/opt/local
|
|
||||||
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
|
|
||||||
fi
|
|
||||||
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On .
|
|
||||||
|
|
||||||
- name: build project
|
- name: build project
|
||||||
run: cmake --build . --target package --verbose -j4
|
run: cmake --build . --target package --verbose -j4
|
||||||
|
|
||||||
|
- name: verify universal binary
|
||||||
|
run: lipo -archs fastfetch
|
||||||
|
|
||||||
- name: list features
|
- name: list features
|
||||||
run: ./fastfetch --list-features
|
run: ./fastfetch --list-features
|
||||||
|
|
||||||
@@ -78,7 +51,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
real_seconds=$(awk '$1 == "real" { print $2 }' fastfetch.time)
|
real_seconds=$(awk '$1 == "real" { print $2 }' fastfetch.time)
|
||||||
jq -e 'type == "array"' fastfetch.json > /dev/null
|
jq -e 'type == "array"' fastfetch.json > /dev/null
|
||||||
jq --arg platform "macos" --arg arch "${{ inputs.arch }}" --argjson real_seconds "$real_seconds" '
|
jq --arg platform "macos" --arg arch "universal" --argjson real_seconds "$real_seconds" '
|
||||||
map(select(.stat | type == "number") | {
|
map(select(.stat | type == "number") | {
|
||||||
name: ("fastfetch " + $platform + " " + $arch + " module " + .type),
|
name: ("fastfetch " + $platform + " " + $arch + " module " + .type),
|
||||||
unit: "ms",
|
unit: "ms",
|
||||||
@@ -103,11 +76,11 @@ jobs:
|
|||||||
- name: upload artifacts
|
- name: upload artifacts
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: fastfetch-macos-${{ inputs.arch }}
|
name: fastfetch-macos-universal
|
||||||
path: ./fastfetch-*.*
|
path: ./fastfetch-*.*
|
||||||
|
|
||||||
- name: upload benchmark data
|
- name: upload benchmark data
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: benchmark-macos-${{ inputs.arch }}
|
name: benchmark-macos-universal
|
||||||
path: benchmark.json
|
path: benchmark.json
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
msystem: ${{ inputs.msystem }}
|
msystem: ${{ inputs.msystem }}
|
||||||
update: true
|
update: true
|
||||||
install: git mingw-w64-clang-${{ inputs.msys-arch }}-7zip mingw-w64-clang-${{ inputs.msys-arch }}-cmake mingw-w64-clang-${{ inputs.msys-arch }}-clang mingw-w64-clang-${{ inputs.msys-arch }}-jq mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-loader mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-headers mingw-w64-clang-${{ inputs.msys-arch }}-opencl-icd mingw-w64-clang-${{ inputs.msys-arch }}-opencl-headers mingw-w64-clang-${{ inputs.msys-arch }}-cppwinrt mingw-w64-clang-${{ inputs.msys-arch }}-imagemagick mingw-w64-clang-${{ inputs.msys-arch }}-chafa mingw-w64-clang-${{ inputs.msys-arch }}-lua mingw-w64-clang-${{ inputs.msys-arch }}-directx-headers
|
install: git mingw-w64-clang-${{ inputs.msys-arch }}-7zip mingw-w64-clang-${{ inputs.msys-arch }}-cmake mingw-w64-clang-${{ inputs.msys-arch }}-clang mingw-w64-clang-${{ inputs.msys-arch }}-jq mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-loader mingw-w64-clang-${{ inputs.msys-arch }}-vulkan-headers mingw-w64-clang-${{ inputs.msys-arch }}-opencl-icd mingw-w64-clang-${{ inputs.msys-arch }}-opencl-headers mingw-w64-clang-${{ inputs.msys-arch }}-cppwinrt mingw-w64-clang-${{ inputs.msys-arch }}-chafa mingw-w64-clang-${{ inputs.msys-arch }}-lua mingw-w64-clang-${{ inputs.msys-arch }}-directx-headers
|
||||||
|
|
||||||
- name: print msys version
|
- name: print msys version
|
||||||
run: uname -a
|
run: uname -a
|
||||||
|
|||||||
@@ -89,20 +89,10 @@ jobs:
|
|||||||
|
|
||||||
macos-hosts:
|
macos-hosts:
|
||||||
needs: no-features-test
|
needs: no-features-test
|
||||||
name: macOS-${{ matrix.arch }}
|
name: macOS-universal
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch: amd64
|
|
||||||
runs-on: macos-15-intel
|
|
||||||
- arch: aarch64
|
|
||||||
runs-on: macos-latest
|
|
||||||
uses: ./.github/workflows/build-macos-hosts.yml
|
uses: ./.github/workflows/build-macos-hosts.yml
|
||||||
with:
|
|
||||||
arch: ${{ matrix.arch }}
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
|
|
||||||
omnios-amd64:
|
omnios-amd64:
|
||||||
needs: no-features-test
|
needs: no-features-test
|
||||||
|
|||||||
+6
-1
@@ -2561,7 +2561,12 @@ install(
|
|||||||
|
|
||||||
set(CPACK_GENERATOR "TGZ;ZIP")
|
set(CPACK_GENERATOR "TGZ;ZIP")
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
string(TOLOWER "${CMAKE_PROJECT_NAME}-macos-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) # use macos instead of darwin
|
if(CMAKE_OSX_ARCHITECTURES MATCHES ";") # multiple architectures, e.g. arm64;x86_64
|
||||||
|
set(_FF_CPACK_ARCH universal)
|
||||||
|
else()
|
||||||
|
set(_FF_CPACK_ARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
|
string(TOLOWER "${CMAKE_PROJECT_NAME}-macos-${_FF_CPACK_ARCH}" CPACK_PACKAGE_FILE_NAME) # use macos instead of darwin
|
||||||
elseif(IS_MUSL)
|
elseif(IS_MUSL)
|
||||||
string(TOLOWER "${CMAKE_PROJECT_NAME}-musl-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME)
|
string(TOLOWER "${CMAKE_PROJECT_NAME}-musl-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME)
|
||||||
else()
|
else()
|
||||||
|
|||||||
Reference in New Issue
Block a user