added a section related to the gnu-sed error message on Mac OS #259
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PVSNESLIB Build & Release | |
# ------------------------------------ # | |
# Events to trigger the action # | |
# ------------------------------------ # | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "develop" | |
# ------------------------------------ # | |
# Set O.S matrix # | |
# ------------------------------------ # | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
name: linux | |
- os: windows-latest | |
name: windows | |
- os: macos-latest | |
name: darwin | |
steps: | |
# ------------------------------------ # | |
# Install dependencies # | |
# ------------------------------------ # | |
- name: Install dependencies for Linux | |
if: matrix.name == 'linux' | |
run: | | |
sudo apt update -y | |
sudo apt-get install -y build-essential \ | |
gcc-12 \ | |
cmake \ | |
make \ | |
git \ | |
doxygen | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 | |
- name: Install dependencies for Windows | |
if: matrix.name == 'windows' | |
uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: UCRT64 | |
install: >- | |
mingw-w64-ucrt-x86_64-toolchain | |
mingw-w64-ucrt-x86_64-cmake | |
mingw-w64-ucrt-x86_64-pcre2 | |
mingw-w64-ucrt-x86_64-doxygen | |
base-devel | |
git | |
zip | |
- name: Install dependencies for MacOS | |
if: matrix.name == 'darwin' | |
run: | | |
brew update | |
rm -f '/usr/local/bin/2to3' | |
brew install doxygen | |
brew install gnu-sed | |
sudo ln -s /usr/local/bin/gcc-12 /usr/local/bin/gcc | |
sudo ln -s /usr/local/bin/g++-12 /usr/local/bin/g++ | |
# ------------------------------------ # | |
# Checkout the project # | |
# ------------------------------------ # | |
- name: Check out PVSNESLIB | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
submodules: recursive | |
persist-credentials: false | |
# ------------------------------------ # | |
# Compiling sources and create release # | |
# ------------------------------------ # | |
- name: Build & Release PVSNESLIB for Linux | |
if: (matrix.name == 'linux') | |
run: | | |
export PVSNESLIB_HOME=$(pwd) | |
make release | tee pvsneslib_release_${{ matrix.name }}.log | |
- name: Build & Release PVSNESLIB for Windows | |
if: (matrix.name == 'windows') | |
shell: msys2 {0} | |
run: | | |
export PVSNESLIB_HOME=$(pwd) | |
make release | tee pvsneslib_release_${{ matrix.name }}.log | |
- name: Build & Release PVSNESLIB for MacOS | |
if: (matrix.name == 'darwin') | |
run: | | |
export PVSNESLIB_HOME=$(pwd) | |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" | |
make release | tee pvsneslib_release_${{ matrix.name }}.log | |
# ------------------------------------ # | |
# Checking libraries linking # | |
# ------------------------------------ # | |
- name: Checking libraries linking PVSNESLIB toolchain | |
if: matrix.name == 'darwin' | |
run: | | |
otool -L devkitsnes/bin/* devkitsnes/tools/* | tee pvsneslib_toolchain_linking_${{ matrix.name }}.log || true | |
- name: Checking libraries linking PVSNESLIB toolchain | |
if: matrix.name == 'windows' || matrix.name == 'linux' | |
run: | | |
ldd devkitsnes/bin/* devkitsnes/tools/* | tee pvsneslib_toolchain_linking_${{ matrix.name }}.log || true | |
# ------------------------------------ # | |
# Upload releases # | |
# ------------------------------------ # | |
- name: Upload PVSNESLIB release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PVSNESLIB Release for ${{ matrix.name }} | |
path: release/pvsneslib_64b_${{ matrix.name }}.zip | |
# ------------------------------------ # | |
# Upload releases # | |
# ------------------------------------ # | |
- name: Upload PVSNESLIB logs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PVSNESLIB Release Logs for ${{ matrix.name }} | |
path: "*.log" |