Skip to content

Commit

Permalink
ci(github): add macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Oct 4, 2024
1 parent 66d9a98 commit 4f2c0e4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,32 @@ jobs:
path: |
hicolor
mac:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
.github/workflows/install-deps.sh
- name: Build and test
run: |
make test
- name: Bundle dynamic libraries
run: |
dylibbundler --bundle-deps --create-dir --fix-file hicolor
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: hicolor-macos-arm64
path: |
hicolor
libs/
windows:
runs-on: windows-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/install-deps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#! /bin/sh
set -e

if [ "$(uname)" = Darwin ]; then
brew install dylibbundler libpng tcl-tk
fi

if [ "$(uname)" = Linux ]; then
apt-get install -y graphicsmagick pkgconf
fi
Expand Down
10 changes: 9 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
PLATFORM ?= $(shell uname)

ifeq ($(PLATFORM), Darwin)
PLATFORM_CFLAGS ?=
else
PLATFORM_CFLAGS ?= -static -Wl,--gc-sections
endif

LIBPNG_CFLAGS ?= $(shell pkg-config --cflags libpng)
LIBPNG_LIBS ?= $(shell pkg-config --libs libpng)
ZLIB_CFLAGS ?= $(shell pkg-config --cflags zlib)
ZLIB_LIBS ?= $(shell pkg-config --libs zlib)

CFLAGS ?= -g -O3 -static -ffunction-sections -fdata-sections -Wl,--gc-sections -Wall -Wextra $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS)
CFLAGS ?= -g -O3 $(PLATFORM_CFLAGS) -ffunction-sections -fdata-sections -Wall -Wextra $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS)
LIBS ?= $(LIBPNG_LIBS) $(ZLIB_LIBS) -lm
PREFIX ?= /usr/local

Expand Down

0 comments on commit 4f2c0e4

Please sign in to comment.