From d51dc7a1943ac5fa28abd307c89fb96136dd9017 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 30 Dec 2021 01:39:47 -0700 Subject: [PATCH] macos: preliminary auto-build.yml github action - add build-macos.sh script - copy Quakespasm-Spiked.txt to build artifacts folder - create Quakespasm-Spiked-Revision.txt file --- .github/workflows/auto-build.yml | 29 +++++++++++++++++++++ MacOSX/.gitignore | 2 ++ MacOSX/QuakeSpasm.xcodeproj/project.pbxproj | 10 ++++--- MacOSX/build-macos.sh | 17 ++++++++++++ MacOSX/setup-vcpkg.sh | 6 +++-- 5 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/auto-build.yml create mode 100755 MacOSX/build-macos.sh diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml new file mode 100644 index 00000000..4c7d4638 --- /dev/null +++ b/.github/workflows/auto-build.yml @@ -0,0 +1,29 @@ +name: Auto Build + +on: + push + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-10.15] + + steps: + - uses: actions/checkout@v2 + + - name: macOS Build + if: runner.os == 'macOS' + run: | + cd MacOSX + ./build-macos.sh + + - name: Upload macOS artifact + uses: actions/upload-artifact@v2 + if: runner.os == 'macOS' + with: + name: macos + path: | + MacOSX/build/Release/*.zip diff --git a/MacOSX/.gitignore b/MacOSX/.gitignore index 567609b1..1c235aec 100644 --- a/MacOSX/.gitignore +++ b/MacOSX/.gitignore @@ -1 +1,3 @@ build/ +vcpkg/ +**/xcuserdata/ diff --git a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj index ec8730b4..5fee19af 100644 --- a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj +++ b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj @@ -216,6 +216,8 @@ 668A0130277D1B4E009D9427 /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 668A0123277D1B4E009D9427 /* libopus.a */; }; 668A0131277D1B4E009D9427 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 668A0124277D1B4E009D9427 /* libz.a */; }; 668A0132277D1B4E009D9427 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 668A0124277D1B4E009D9427 /* libz.a */; }; + 668A0136277D809A009D9427 /* Quakespasm-Spiked.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 668A0133277D8068009D9427 /* Quakespasm-Spiked.txt */; }; + 668A0137277D80B0009D9427 /* Quakespasm-Spiked.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 668A0133277D8068009D9427 /* Quakespasm-Spiked.txt */; }; 66991C071DBAB4A600C373C0 /* quakespasm.pak in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C061DBAB48000C373C0 /* quakespasm.pak */; }; 66991C081DBAB4A600C373C0 /* LICENSE.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C021DBAB47000C373C0 /* LICENSE.txt */; }; 66991C091DBAB4A600C373C0 /* Quakespasm-Music.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */; }; @@ -288,6 +290,7 @@ dstPath = ""; dstSubfolderSpec = 16; files = ( + 668A0137277D80B0009D9427 /* Quakespasm-Spiked.txt in CopyFiles */, 66991C071DBAB4A600C373C0 /* quakespasm.pak in CopyFiles */, 66991C081DBAB4A600C373C0 /* LICENSE.txt in CopyFiles */, 66991C091DBAB4A600C373C0 /* Quakespasm-Music.txt in CopyFiles */, @@ -302,6 +305,7 @@ dstPath = ""; dstSubfolderSpec = 16; files = ( + 668A0136277D809A009D9427 /* Quakespasm-Spiked.txt in CopyFiles */, 66991C0D1DBAB4B300C373C0 /* quakespasm.pak in CopyFiles */, 66991C0E1DBAB4B300C373C0 /* LICENSE.txt in CopyFiles */, 66991C0F1DBAB4B300C373C0 /* Quakespasm-Music.txt in CopyFiles */, @@ -494,6 +498,7 @@ 668A0122277D1B4E009D9427 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = "vcpkg/installed/x64-osx-10.9/lib/libogg.a"; sourceTree = ""; }; 668A0123277D1B4E009D9427 /* libopus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopus.a; path = "vcpkg/installed/x64-osx-10.9/lib/libopus.a"; sourceTree = ""; }; 668A0124277D1B4E009D9427 /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libz.a; path = "vcpkg/installed/x64-osx-10.9/lib/libz.a"; sourceTree = ""; }; + 668A0133277D8068009D9427 /* Quakespasm-Spiked.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "Quakespasm-Spiked.txt"; path = "../Quakespasm-Spiked.txt"; sourceTree = ""; }; 66991C021DBAB47000C373C0 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = LICENSE.txt; path = ../LICENSE.txt; sourceTree = ""; }; 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "Quakespasm-Music.txt"; path = "../Quakespasm-Music.txt"; sourceTree = ""; }; 66991C041DBAB47000C373C0 /* Quakespasm.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Quakespasm.html; path = ../Quakespasm.html; sourceTree = ""; }; @@ -891,6 +896,7 @@ 66991C061DBAB48000C373C0 /* quakespasm.pak */, 66991C021DBAB47000C373C0 /* LICENSE.txt */, 66991C031DBAB47000C373C0 /* Quakespasm-Music.txt */, + 668A0133277D8068009D9427 /* Quakespasm-Spiked.txt */, 66991C041DBAB47000C373C0 /* Quakespasm.html */, 66991C051DBAB47000C373C0 /* Quakespasm.txt */, ); @@ -1252,9 +1258,7 @@ 664D98F819CF6B78000D395C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - x86_64, - ); + ARCHS = x86_64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", diff --git a/MacOSX/build-macos.sh b/MacOSX/build-macos.sh new file mode 100755 index 00000000..74f70511 --- /dev/null +++ b/MacOSX/build-macos.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +./setup-vcpkg.sh + +xcodebuild -project QuakeSpasm.xcodeproj -target QuakeSpasm-Spiked-SDL2 + +cat < build/Release/Quakespasm-Spiked-Revision.txt +Git URL: $(git config --get remote.origin.url) +Git Revision: $(git rev-parse HEAD) +Git Date: $(git show --no-patch --no-notes --pretty='%ai' HEAD) +Compile Date: $(date) +EOF + +# zip the files in `build/Release` to create the final archive for distribution +cd build/Release +rm Quakespasm-Spiked-macos.zip +zip --symlinks --recurse-paths Quakespasm-Spiked-macos.zip * diff --git a/MacOSX/setup-vcpkg.sh b/MacOSX/setup-vcpkg.sh index dbe30464..0f8540ee 100755 --- a/MacOSX/setup-vcpkg.sh +++ b/MacOSX/setup-vcpkg.sh @@ -1,6 +1,8 @@ #!/bin/bash -git clone --depth 1 https://github.com/microsoft/vcpkg -./vcpkg/bootstrap-vcpkg.sh +if [ ! -d "vcpkg" ]; then + git clone --depth 1 https://github.com/microsoft/vcpkg + ./vcpkg/bootstrap-vcpkg.sh +fi ./vcpkg/vcpkg install --overlay-triplets=custom-triplets --triplet=x64-osx-10.9 zlib libogg opus opusfile libvorbis