Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI and Add MacOS ARM #505

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 52 additions & 16 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
fail-fast: false
matrix:
config:
- { name: "gcc 13", cc: gcc-13, tidy: "On" }
- { name: "clang 15", cc: clang-15, tidy: "Off" }
- { name: "gcc 14", cc: gcc-14, tidy: "On" }
- { name: "clang 16", cc: clang-16, tidy: "Off" }

steps:
- uses: actions/checkout@v4
Expand All @@ -55,7 +55,7 @@ jobs:
-DUSE_TIDY=${{ matrix.config.tidy }} \
-DUSE_TESTS=On \
-DUSE_TOOLS=On ..
make -j2
make -j $(getconf _NPROCESSORS_ONLN)

- name: Run tests
run: |
Expand Down Expand Up @@ -83,8 +83,8 @@ jobs:
run: |
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release ..
make -j2
make install
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install

- name: Get short SHA
id: slug
Expand All @@ -94,7 +94,7 @@ jobs:
run: tar cvfz ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64.tar.gz -C build-release/release/ .

- name: Upload TGZ artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64
path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_linux_amd64.tar.gz
Expand All @@ -111,7 +111,7 @@ jobs:
desc: 'One Must Fall 2097 Remake'

- name: Upload DEB artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_deb_amd64
path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_amd64.deb
Expand All @@ -136,8 +136,8 @@ jobs:
run: |
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release ..
make -j3
make install
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install

- name: Get short SHA
id: slug
Expand All @@ -149,11 +149,47 @@ jobs:
zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12.zip .

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12
path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos12.zip

build_macos-arm:
needs: [unittest, formatting-check]

name: Build macos-14
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- name: Install Mac Dependencies
run: |
brew update
brew install cmake argtable cunit sdl2_mixer confuse enet sdl2 libxmp libpng

- name: Generate Release
run: |
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release ..
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install

- name: Get short SHA
id: slug
run: echo "sha8=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT

- name: Generate ZIP package
run: |
cd build-release/release
zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip .

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm
path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip

# Build windows package, release artifact and update "latest" release if necessary.
# -----------------------------------------------------------------------------------------------
build_windows:
Expand Down Expand Up @@ -183,8 +219,8 @@ jobs:
-DCMAKE_LIBRARY_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/lib/" \
-DCMAKE_FIND_ROOT_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \
"${GITHUB_WORKSPACE}"
make -j2
make install
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) install
cp ${GITHUB_WORKSPACE}/openomf-win-build-main/bin/*.dll release/openomf/

- name: Get short SHA
Expand All @@ -197,7 +233,7 @@ jobs:
zip -r ${GITHUB_WORKSPACE}/openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip openomf

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64
path: openomf_0.6.6-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip
Expand All @@ -206,7 +242,7 @@ jobs:
# Create a "latest" release
# -----------------------------------------------------------------------------------------------
make_release:
needs: [build_windows, build_macos, build_ubuntu]
needs: [build_windows, build_macos, build_macos-arm, build_ubuntu]
if: github.ref == 'refs/heads/master'

name: Make "latest" release
Expand All @@ -217,12 +253,12 @@ jobs:
with:
fetch-depth: '0'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts/

- name: Advance tag
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
Loading