mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-07 09:48:22 +00:00
100 lines
2.7 KiB
YAML
100 lines
2.7 KiB
YAML
name: Build on OSX
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
paths:
|
|
- .github/workflows/build-macos.yml
|
|
- contrib/static/build-macos.sh
|
|
- daemon/**
|
|
- i18n/**
|
|
- libi2pd/**
|
|
- libi2pd_client/**
|
|
- Makefile
|
|
- Makefile.homebrew
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
workflow_call:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.name }}
|
|
runs-on: ${{ matrix.runner }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# the universal binary needs cross-compilation, so it is built for releases only
|
|
include: ${{ fromJSON(github.ref_type == 'tag' && '[{"name":"universal","runner":"macos-15","archs":"arm64 x86_64"}]' || '[{"name":"arm64","runner":"macos-15","archs":"arm64"},{"name":"x86_64","runner":"macos-15-intel","archs":"x86_64"}]') }}
|
|
|
|
env:
|
|
ARCHS: ${{ matrix.archs }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build application
|
|
run: sh contrib/static/build-macos.sh
|
|
|
|
- name: Check binary
|
|
run: |
|
|
for arch in $ARCHS; do lipo -archs i2pd | grep -w $arch; done
|
|
otool -L i2pd
|
|
test -z "$(otool -L i2pd | grep -E '^[[:space:]]' | grep -vE '^[[:space:]]+(/usr/lib/|/System/Library/)')"
|
|
vtool -show-build i2pd | grep -E 'architecture|minos|sdk'
|
|
set -- $ARCHS
|
|
test "$(vtool -show-build i2pd | grep -c 'minos 12\.0$')" = $#
|
|
./i2pd --version
|
|
./i2pd --version | grep -E '^OpenSSL (3\.([5-9]|[1-9][0-9])|[4-9])\.'
|
|
./i2pd --version | grep -E '^Boost version 1\.(8[1-9]|9[0-9])\.'
|
|
|
|
- name: Run
|
|
run: |
|
|
mkdir datadir
|
|
./i2pd --datadir=datadir --log=file --logfile=datadir/i2pd.log --loglevel=info &
|
|
sleep 15
|
|
kill -0 $!
|
|
grep 'Daemon: Starting NetDB' datadir/i2pd.log
|
|
kill -9 $!
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: i2pd-macos-${{ matrix.name }}
|
|
path: i2pd
|
|
|
|
test:
|
|
name: Run universal binary on ${{ matrix.target-name }}
|
|
if: github.ref_type == 'tag'
|
|
needs: build
|
|
runs-on: ${{ matrix.target }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: macos-14
|
|
target-name: macOS 14 ARM64
|
|
- target: macos-15-intel
|
|
target-name: macOS 15 Intel x86_64
|
|
|
|
steps:
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i2pd-macos-universal
|
|
|
|
- name: Run
|
|
run: |
|
|
chmod +x i2pd
|
|
./i2pd --version
|
|
mkdir datadir
|
|
./i2pd --datadir=datadir --log=file --logfile=datadir/i2pd.log --loglevel=info &
|
|
sleep 15
|
|
kill -0 $!
|
|
grep 'Daemon: Starting NetDB' datadir/i2pd.log
|
|
kill -9 $!
|