forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(MacOS): Fully replace Xcode by CMake for MacOS build (endless-s…
- Loading branch information
Showing
24 changed files
with
143 additions
and
2,072 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,42 +37,48 @@ jobs: | |
asset_name: ${{ env.OUTPUT }} | ||
asset_content_type: application/octet-stream | ||
|
||
dmg_macos: | ||
name: MacOS | ||
runs-on: macos-latest | ||
|
||
release_macos_universal: | ||
name: MacOS Universal | ||
runs-on: macos-12 | ||
env: | ||
OUTPUT: endless-sky-macos-${{ github.event.release.tag_name }} | ||
SDL2_FRAMEWORK: build/SDL2.framework | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OUTPUT: Endless-Sky-${{ github.event.release.tag_name }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Update Homebrew | ||
run: brew update | ||
- name: Install dependencies | ||
run: brew install libpng jpeg-turbo | ||
- name: Restore cached SDL2 framework | ||
uses: actions/cache@v3 | ||
- name: Setup sccache | ||
uses: ./.github/sccache | ||
with: | ||
path: ${{ env.SDL2_FRAMEWORK }} | ||
key: macos-latest-sdl2-${{ hashFiles('EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }} | ||
- name: Build Application | ||
run: xcodebuild -configuration "Release" -jobs $(sysctl -n hw.logicalcpu) -quiet | ||
- name: Package Application | ||
read-only: 'true' | ||
- uses: lukka/get-cmake@latest | ||
- uses: lukka/run-vcpkg@v10 | ||
with: | ||
vcpkgGitCommitId: '163fe7bd3d67c41200617caaa245b5ba2ba854e6' | ||
- uses: lukka/run-cmake@v10 | ||
with: | ||
configurePreset: 'macos-arm-release' | ||
buildPreset: 'macos-ci-release' | ||
- name: Prepare for x64 app bundle | ||
run: | | ||
cd build/Release | ||
mkdir ${{ env.OUTPUT }} | ||
mv Endless\ Sky.app ${{ env.OUTPUT }} | ||
ln -s /Applications ${{ env.OUTPUT }} | ||
hdiutil create -ov -fs HFS+ -format UDZO -imagekey zlib-level=9 -srcfolder ${{ env.OUTPUT }} ${{ github.workspace }}/${{ env.OUTPUT }}.dmg | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
mv "build/release/Endless Sky.app" "Endless Sky.app.arm" | ||
rm -rf build/release | ||
- uses: lukka/run-cmake@v10 | ||
with: | ||
name: ${{ env.OUTPUT }}.dmg | ||
path: ${{ env.OUTPUT }}.dmg | ||
- name: Upload disk image | ||
uses: actions/[email protected] | ||
configurePreset: 'macos-release' | ||
buildPreset: 'macos-ci-release' | ||
- name: Create universal binary | ||
run: | | ||
mv "build/release/Endless Sky.app" "Endless Sky.app.x64" | ||
cp -r "Endless Sky.app.arm" "Endless Sky.app" | ||
lipo -create -output "Endless Sky.app/Contents/MacOS/Endless Sky" "Endless Sky.app.arm/Contents/MacOS/Endless Sky" "Endless Sky.app.x64/Contents/MacOS/Endless Sky" | ||
for lib in "Endless Sky.app/Contents/Frameworks/"*; do lipo -create -output "$lib" "Endless Sky.app.arm/Contents/Frameworks/$(basename "$lib")" "Endless Sky.app.x64/Contents/Frameworks/$(basename "$lib")"; done | ||
- name: Package Application | ||
run: | | ||
mkdir "${{ env.OUTPUT }}" | ||
cp -r "Endless Sky.app" "${{ env.OUTPUT }}" | ||
ln -s /Applications "${{ env.OUTPUT }}" | ||
hdiutil create -ov -fs HFS+ -format UDZO -imagekey zlib-level=9 -srcfolder "${{ env.OUTPUT }}" "${{ github.workspace }}/${{ env.OUTPUT }}.dmg" | ||
- name: Upload Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.OUTPUT }}.dmg | ||
asset_name: ${{ env.OUTPUT }}.dmg | ||
asset_content_type: application/octet-stream | ||
files: ${{ env.OUTPUT }}.dmg |
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
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
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
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
Oops, something went wrong.