Build and Release Executables #6
Workflow file for this run
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: Build and Release Executables | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
xp_version: [11, 12] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: melusina-org/setup-macports@v1 | |
if: startsWith(matrix.os, 'macos') | |
with: | |
macports-version: 2.7.1 | |
- uses: msys2/setup-msys2@v2 | |
if: startsWith(matrix.os, 'windows') | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
git | |
curl | |
mingw-w64-x86_64-expat | |
- name: Get XPlane SDK | |
shell: bash | |
run: | | |
SDK_VERSION=411 | |
curl -L "https://developer.x-plane.com/wp-content/plugins/code-sample-generation/sdk_zip_files/XPSDK${SDK_VERSION}.zip" -o "XPSDK${SDK_VERSION}.zip" | |
unzip XPSDK${SDK_VERSION}.zip | |
mv SDK ../ | |
- name: Build Executable | |
shell: bash | |
env: | |
OS: ${{ matrix.os }} | |
XP_VERSION: ${{ matrix.xp_version }} | |
run: | | |
if [ $XP_VERSION == "11" ]; then | |
export MK_TARG=openSAM.xpl_xp11 | |
else | |
export MK_TARG=openSAM.xpl | |
fi | |
if [ $OS == "ubuntu-latest" ]; then | |
sudo apt-get -y install libopenal1 libopenal-dev | |
make -f Makefile.lin64 OBJDIR=./OBJ ./OBJ/${MK_TARG} | |
else | |
if [ $OS == "windows-latest" ]; then | |
ls / | |
echo $PATH | |
git clone https://github.com/hotbso/libOpenAL32.git | |
make -f Makefile.mgw64 OBJDIR=./OBJ OPENAL=./libOpenAL32 ./OBJ/${MK_TARG} | |
else | |
port install expat +universal | |
make -f Makefile.mac64 OBJDIR=./OBJ ./OBJ/${MK_TARG} | |
fi | |
fi | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./build | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{ github.workspace }}/build/windows-latest-build/o4xp_2_xp12.exe | |
${{ github.workspace }}/build/ubuntu-latest-build/o4xp_2_xp12_ubuntu-latest | |
${{ github.workspace }}/build/macos-13-build/o4xp_2_xp12_macos-13 | |
prerelease: ${{ contains(github.ref_name, '-') }} |