workflows: pre-init macos

This commit is contained in:
wipedlifepotato 2025-10-16 13:04:09 +03:00
parent ad258113c1
commit fb48cdd9e1
2 changed files with 74 additions and 52 deletions

View file

@ -12,10 +12,11 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
compiler: [clang]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
@ -31,46 +32,58 @@ jobs:
sudo apt update
sudo apt install --no-install-recommends -y build-essential libboost-all-dev libssl-dev git
- name: Cache build artifacts (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v3
with:
path: |
obj
libi2pd.a
key: ubuntu-build-${{ runner.os }}-${{ hashFiles('**/*.cpp', '**/*.h') }}
#
# - name: Install MSYS2 (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# Invoke-WebRequest -Uri "https://github.com/msys2/msys2-installer/releases/download/2025-08-30/msys2-x86_64-20250830.exe" -OutFile "msys2-installer.exe"
# Start-Process -Wait -FilePath "msys2-installer.exe" -ArgumentList "/S"
# C:\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm"
# C:\msys64\usr\bin\bash.exe -lc "export ARCH=x86_64; export MINGW=mingw64; pacman -S --noconfirm mingw-w64-$ARCH-gcc mingw-w64-$ARCH-boost mingw-w64-$ARCH-openssl git make"
#######################
# macOS dependencies #
#######################
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install boost openssl@3 cmake make
#######################
# Windows dependencies #
#######################
- name: Install MSYS2 (Windows)
uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
install: base-devel git mingw-w64-x86_64-clang mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-miniupnpc
update: true
- name: Initialize Git Submodules
run: git submodule update --init --recursive
#######################
# Build Project
#######################
- name: Build Project (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
make -j8
make -j$(nproc)
make stripall
make builddir
#
# - name: Build Project (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# C:\msys64\usr\bin\bash.exe -lc "cd /c/runner/work/i2pd-tools/i2pd-tools && make && make stripall && make builddir"
#
- name: Build Project (macOS)
if: matrix.os == 'macos-latest'
run: |
make HOMEBREW=1 -j8
make stripall
make builddir
- name: Build Project (Windows)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
cd "${GITHUB_WORKSPACE}"
make -j$(nproc)
make stripall
make builddir
#######################
# Upload binaries
#######################
- name: Upload binaries
uses: actions/upload-artifact@v4
with: