-
Notifications
You must be signed in to change notification settings - Fork 87
74 lines (60 loc) · 2.89 KB
/
build-macos-intel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: m8c macos intel build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-macos:
runs-on: macos-12
env:
SDL_VERSION: 2.30.4
steps:
- name: 'Install dependencies'
run: brew install cmake pkg-config autoconf automake libtool
- name: 'Cache x86_64 files'
id: cache-x86_64-files
uses: actions/cache@v4
with:
path: '/Users/runner/x86_64'
key: mac-x86_64-files
- name: 'Download 10.9 SDK for x86_64'
if: steps.cache-x86_64-files.outputs.cache-hit != 'true'
run: |
mkdir -p "$HOME/x86_64"
pushd "$HOME/x86_64"
mkdir SDKs
cd SDKs
curl -L "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.9.sdk.tar.xz" | tar -xvf -
popd
- name: 'Checkout'
uses: actions/checkout@v4
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Download SDL2 sources'
run: |
(curl https://www.libsdl.org/release/SDL2-$SDL_VERSION.tar.gz || curl -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz) | tar xvf -
- name: 'Build SDL2'
run: |
export MACOSX_DEPLOYMENT_TARGET="10.9" && cd SDL2-$SDL_VERSION && mkdir build_x86_64 && cd build_x86_64 && ../configure CPPFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" --prefix="$HOME/x86_64prefix" && make && make install
- name: 'Download libserialport sources'
run: |
curl -L -O https://github.com/sigrokproject/libserialport/archive/refs/heads/master.zip && unzip master.zip && rm master.zip
- name: 'Build libserialport'
run: |
pushd libserialport-master
mkdir autostuff
autoreconf -I"$HOME/x86_64prefix/share/aclocal" -i
export MACOSX_DEPLOYMENT_TARGET="10.9" && mkdir build_x86_64 && cd build_x86_64 && ../configure CFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" --prefix="$HOME/x86_64prefix" && make && make install
popd
- name: 'Build m8c'
run: |
export MACOSX_DEPLOYMENT_TARGET="10.9" && export PKG_CONFIG_PATH="$HOME/x86_64prefix/lib/pkgconfig" && export CFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" && mkdir build_x86_64 && cd build_x86_64 && cmake .. && cpack -V
- name: 'Build package'
run: |
mv build_x86_64/m8c-0.1.1-Darwin.dmg m8c-${{ env.NOW }}-macos-intel.dmg
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: m8c-${{ env.NOW }}-macos-intel
path: |
m8c-${{ env.NOW }}-macos-intel.dmg