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

Add macos artifact uploading #513

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 18 additions & 5 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
fail-fast: false
matrix:
config:

- name: "MSVC x64"
os: windows-latest
build_type: "Release"
Expand All @@ -26,7 +25,7 @@ jobs:
-A x64
-DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=x64-windows

- name: "MSYS2 UCRT64"
os: windows-latest
build_type: "Release"
Expand All @@ -44,12 +43,24 @@ jobs:
package_name: "linux_gcc"
shell: bash
artifact-path: build/*.appimage

- name: "macOS Clang"
- name: "macOS arm64 Clang"
os: macos-latest
build_type: "Release"
extra_options: "-G Ninja"
package_name: "mac_arm64"
shell: bash
artifact-path: build/*.zip


- name: "macOS x64 Clang"
os: macos-13
build_type: "Release"
extra_options: "-G Ninja"
package_name: "mac_x64"
shell: bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecc078a is not correct, do not change the matrix.config section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my bad, I used the "Resolve Conflict" button on github. It changed more than what I thought

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Im on my pc, umm whats the problem? Can't I add the macOS x64 Clang to matrix.config?

The commit you linked is just github synching stuff, and it is not really part of the PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't I add the macOS x64 Clang to matrix.config?

You can, but you also changed the syntax to earlier { }. I've used >- in MSVC configuration which is not compatible with it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix MSVC build:

diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml
index e2cea90e6..e28727a7d 100644
--- a/.github/workflows/continuous_integration.yml
+++ b/.github/workflows/continuous_integration.yml
@@ -16,52 +16,49 @@ jobs:
       fail-fast: false
       matrix:
         config:
-          - {
-              name: "MSVC x64",
-              os: windows-latest,
-              build_type: "Release",
-              extra_options: "-A x64",
-              vcpkg_triplet: x64-windows,
-              shell: bash,
-            }
-          - {
-              name: "MSYS2 UCRT64",
-              os: windows-latest,
-              build_type: "Release",
-              extra_options: "-G Ninja",
-              package_name: "mingw_x64",
-              shell: "msys2 {0}",
-              msystem: ucrt64,
-              msys-env: mingw-w64-ucrt-x86_64,
-              artifact-path: build/*.zip,
-            }
-          - {
-              name: "Linux GCC",
-              os: ubuntu-latest,
-              build_type: "Release",
-              extra_options: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr",
-              package_name: "linux_gcc",
-              shell: bash,
-              artifact-path: build/*.appimage,
-            }
-          - {
-              name: "macOS arm64 Clang",
-              os: macos-latest,
-              build_type: "Release",
-              extra_options: "-G Ninja",
-              package_name: "mac_arm64",
-              shell: bash,
-              artifact-path: build/*.zip,
-            }
-          - {
-              name: "macOS x64 Clang",
-              os: macos-13,
-              build_type: "Release",
-              extra_options: "-G Ninja",
-              package_name: "mac_x64",
-              shell: bash,
-              artifact-path: build/*.zip,
-            }
+          - name: "MSVC x64"
+            os: windows-latest,
+            build_type: "Release"
+            vcpkg_triplet: x64-windows
+            shell: pwsh,
+            extra_options: >-
+              -A x64
+              -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake"
+              -DVCPKG_TARGET_TRIPLET=x64-windows
+
+          - name: "MSYS2 UCRT64"
+            os: windows-latest
+            build_type: "Release"
+            extra_options: "-G Ninja"
+            package_name: "mingw_x64"
+            shell: "msys2 {0}"
+            msystem: ucrt64
+            msys-env: mingw-w64-ucrt-x86_64
+            artifact-path: build/*.zip
+
+          - name: "Linux GCC"
+            os: ubuntu-latest
+            build_type: "Release"
+            extra_options: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr"
+            package_name: "linux_gcc"
+            shell: bash
+            artifact-path: build/*.appimage
+
+          - name: "macOS arm64 Clang"
+            os: macos-latest
+            build_type: "Release"
+            extra_options: "-G Ninja"
+            package_name: "mac_arm64"
+            shell: bash
+            artifact-path: build/*.zip
+
+          - name: "macOS x64 Clang"
+            os: macos-13
+            build_type: "Release"
+            extra_options: "-G Ninja"
+            package_name: "mac_x64"
+            shell: bash
+            artifact-path: build/*.zip
 
     steps:
       - uses: actions/checkout@v4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now. Done in 21105ca

Sorry about that 😅

artifact-path: build/*.zip


steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -109,6 +120,7 @@ jobs:
if: runner.os == 'macOS'
run: |
brew update
brew install --overwrite python@3.12
env HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
brew install \
cmake \
Expand All @@ -122,7 +134,8 @@ jobs:
portmidi \
sdl2 \
sdl2_image \
sdl2_mixer
sdl2_mixer \
dylibbundler

- name: Configure
run: >-
Expand Down
48 changes: 48 additions & 0 deletions prboom2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,53 @@ elseif(LINUX)
--icon-file=${CPACK_TEMPORARY_DIRECTORY}/${CPACK_PACKAGING_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/dsda-doom.svg
--output=appimage)
]])
elseif(APPLE)
set(CPACK_GENERATOR External)
set(CPACK_EXTERNAL_ENABLE_STAGING YES)
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${PROJECT_BINARY_DIR}/macbundle-generate.cmake")
set(CPACK_SYSTEM_NAME "mac-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_BUILD_DIR "${PROJECT_BINARY_DIR}")

file(GENERATE
OUTPUT "${PROJECT_BINARY_DIR}/macbundle-generate.cmake"
CONTENT [[
set(CPACK_OUTPUT_DIR "${CPACK_BUILD_DIR}/${CPACK_PACKAGE_FILE_NAME}")
file(MAKE_DIRECTORY ${CPACK_OUTPUT_DIR})

find_program(DYLIBBUNDLER_EXECUTABLE NAMES dylibbundler)
if(NOT DYLIBBUNDLER_EXECUTABLE)
message(FATAL_ERROR "Missing dylibbundler (brew install dylibbundler)")
endif()

file(COPY_FILE
$<TARGET_FILE:dsda-doom>
${CPACK_OUTPUT_DIR}/dsda-doom)

execute_process(COMMAND
${CMAKE_COMMAND} -E env
OUTPUT=${CPACK_PACKAGE_FILE_NAME}.zip
VERSION=$<IF:$<BOOL:${CPACK_PACKAGE_VERSION}>,${CPACK_PACKAGE_VERSION},0.1.0>
${DYLIBBUNDLER_EXECUTABLE}
--bundle-deps
--create-dir
--fix-file ${CPACK_OUTPUT_DIR}/dsda-doom
--install-path @executable_path/libs_${CPACK_SYSTEM_PROCESSOR}
--dest-dir ${CPACK_OUTPUT_DIR}/libs_${CPACK_SYSTEM_PROCESSOR})

file(COPY_FILE
${CPACK_TEMPORARY_DIRECTORY}/${CPACK_PACKAGING_INSTALL_PREFIX}/share/games/doom/dsda-doom.wad
${CPACK_OUTPUT_DIR}/dsda-doom.wad)
file(COPY_FILE
${CPACK_TEMPORARY_DIRECTORY}/${CPACK_PACKAGING_INSTALL_PREFIX}/share/doc/dsda-doom/COPYING
${CPACK_OUTPUT_DIR}/COPYING.txt)

file(CONFIGURE
OUTPUT ${CPACK_OUTPUT_DIR}/Troubleshooting.txt
CONTENT "If you are getting errors like 'libzip.5.5.dylib cant be opened because Apple cannot check it for malicious software.' Run the following command in the dsda-doom folder:\n\nxattr -dr com.apple.quarantine path/to/folder")

execute_process(COMMAND zip -r ${CPACK_PACKAGE_FILE_NAME}.zip ${CPACK_PACKAGE_FILE_NAME})
]])
endif()
include(CPack)
Loading