[RA] Silence warnings C4291 from MSVC. #726
Workflow file for this run
This file contains hidden or 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: macos | |
on: | |
pull_request: | |
push: | |
jobs: | |
vanilla-macos: | |
runs-on: macos-14 | |
strategy: | |
matrix: | |
preset: [release, internal, testing, nonet] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Git Info | |
id: gitinfo | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Setting up Cache-Key | |
run: echo "DEP_CACHE_KEY=$(curl 'https://ports.macports.org/api/v1/ports/dylibbundler/?format=json' | grep -ioE '("version":).[^,]*')-$(curl 'https://ports.macports.org/api/v1/ports/libsdl2/?format=json' | grep -ioE '("version":).[^,]*')-$(curl 'https://ports.macports.org/api/v1/ports/openal-soft/?format=json' | grep -ioE '("version":).[^,]*')" >> $GITHUB_ENV | |
- name: Printing Cache-Key | |
run: echo $DEP_CACHE_KEY | |
- name: Restore cache | |
id: dep-cache | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-dependencies | |
with: | |
path: ~/macports | |
key: ${{ env.DEP_CACHE_KEY }} | |
- name: Install homebrew deps | |
run: | | |
brew install imagemagick dylibbundler | |
- if: ${{ steps.dep-cache.outputs.cache-hit != 'true' }} | |
name: Install macport dependencies | |
run: | | |
wget -q https://github.com/macports/macports-base/releases/download/v2.10.5/MacPorts-2.10.5-14-Sonoma.pkg | |
sudo installer -pkg ./MacPorts-2.10.5-14-Sonoma.pkg -target / | |
export PATH="/opt/local/bin:/opt/local/sbin:$PATH" | |
sudo port selfupdate -N | |
sudo port install libsdl2 +universal -N | |
sudo port install openal-soft +universal -N | |
mkdir ~/macports | |
sudo cp -R /opt/local ~/macports | |
sudo chown -R $USER:staff ~/macports | |
- if: ${{ steps.dep-cache.outputs.cache-hit == 'true' }} | |
name: Restore macport dependencies from cache | |
run: | | |
sudo cp -R ~/macports/local /opt/local | |
- name: Build Vanilla Conquer | |
env: | |
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64" | |
VC_CXX_FLAGS: "-w;-Wwrite-strings;-Werror=write-strings" | |
run: | | |
export PATH="/opt/local/bin:/opt/local/sbin:$PATH" | |
cmake --workflow --preset ${{ matrix.preset }} | |
- name: Create archives | |
if: ${{ matrix.preset != 'testing' && matrix.preset != 'nonet' }} | |
run: | | |
dsymutil build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.app/Contents/MacOS/vanillatd -o build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.dSYM | |
dsymutil build/${{ matrix.preset }}/RelWithDebInfo/vanillara.app/Contents/MacOS/vanillara -o build/${{ matrix.preset }}/RelWithDebInfo/vanillara.dSYM | |
strip -Sx build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.app/Contents/MacOS/vanillatd | |
strip -Sx build/${{ matrix.preset }}/RelWithDebInfo/vanillara.app/Contents/MacOS/vanillara | |
dylibbundler --create-dir --bundle-deps --overwrite-files --dest-dir ./build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.app/Contents/libs --fix-file build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.app/Contents/MacOS/vanillatd | |
dylibbundler --create-dir --bundle-deps --overwrite-files --dest-dir ./build/${{ matrix.preset }}/RelWithDebInfo/vanillara.app/Contents/libs --fix-file build/${{ matrix.preset }}/RelWithDebInfo/vanillara.app/Contents/MacOS/vanillara | |
mkdir artifact | |
7z a artifact/vanilla-conquer-${{ matrix.preset }}-macos-clang-universal2-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.app ./build/${{ matrix.preset }}/RelWithDebInfo/vanillara.app | |
7z a artifact/vanilla-conquer-${{ matrix.preset }}-macos-clang-universal2-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/${{ matrix.preset }}/RelWithDebInfo/vanillatd.dSYM ./build/${{ matrix.preset }}/RelWithDebInfo/vanillara.dSYM | |
- name: Add internal tools to archive | |
if: ${{ matrix.preset == 'internal' }} | |
run: | | |
dsymutil build/${{ matrix.preset }}/RelWithDebInfo/vanillamix -o build/${{ matrix.preset }}/RelWithDebInfo/vanillamix.dSYM | |
strip -Sx build/${{ matrix.preset }}/RelWithDebInfo/vanillamix | |
7z a artifact/vanilla-conquer-${{ matrix.preset }}-macos-clang-universal2--${{ steps.gitinfo.outputs.sha_short }}.zip ./build/${{ matrix.preset }}/RelWithDebInfo/vanillamix | |
7z a artifact/vanilla-conquer-${{ matrix.preset }}-macos-clang-universal2--${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/${{ matrix.preset }}/RelWithDebInfo/vanillamix.dSYM | |
- name: Upload artifact | |
if: ${{ matrix.preset != 'testing' && matrix.preset != 'nonet' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vanilla-conquer-${{ matrix.preset }}-macos-clang-universal2 | |
path: artifact | |
- name: Upload development release | |
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.preset != 'testing' && matrix.preset != 'nonet' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Development Build | |
tag_name: "latest" | |
prerelease: true | |
files: | | |
artifact/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload tagged release | |
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.preset != 'testing' && matrix.preset != 'nonet' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
artifact/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |