Build and Release Executables #17
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: [ubuntu-latest] #, macos-latest] | |
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 | |
- 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 }} | |
run: | | |
if [ $OS == "ubuntu-latest" ]; then | |
sudo apt-get -y install libopenal1 libopenal-dev | |
make -f Makefile.lin64 | |
else | |
port install expat +universal | |
make -f Makefile.mac64 | |
fi | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: | | |
openSAM-pkg/openSAM/*_x64 | |
openSAM-pkg_XP11/openSAM/*_x64 | |
release: | |
runs-on: windows-latest | |
needs: build | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-expat | |
make | |
- uses: actions/checkout@v3 | |
- 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: Get libOpenal32 | |
shell: bash | |
run: | | |
curl -L https://github.com/hotbso/libOpenAL32/archive/refs/heads/main.zip -o libOpenal32.zip | |
unzip libOpenal32.zip | |
- name: Build Windows binaries | |
shell: msys2 {0} | |
run: | | |
make -f Makefile.mgw64 OPENAL=./libOpenAL32-main | |
- 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, '-') }} |