From bbfff0a74aee16dc15c802907e8c8db17d7f98a4 Mon Sep 17 00:00:00 2001 From: Hisanobu Tomari Date: Wed, 20 Dec 2023 20:33:30 +0900 Subject: [PATCH] Build using gha --- .github/workflows/objective-c-xcode.yml | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/objective-c-xcode.yml diff --git a/.github/workflows/objective-c-xcode.yml b/.github/workflows/objective-c-xcode.yml new file mode 100644 index 0000000..2127f8d --- /dev/null +++ b/.github/workflows/objective-c-xcode.yml @@ -0,0 +1,40 @@ +name: Xcode - Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: Build Release configuration + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + run: | + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild clean build -scheme "$scheme" -configuration "Release" -destination "generic/platform=macOS,name=Any Mac" -"$filetype_parameter" "$file_to_build" BUILD_DIR="${PWD}/artifacts" | xcpretty && exit ${PIPESTATUS[0]} + - name: Zip + run: | + pushd artifacts/ + zip -9Xr FlyingJavabo.zip Release + popd + - name: Archive + uses: actions/upload-artifact@v3 + with: + name: binary + path: artifacts/FlyingJavabo.zip