Skip to content

Commit

Permalink
Merge pull request #1 from arigato-java/gha
Browse files Browse the repository at this point in the history
Build on GHA
  • Loading branch information
tomari authored Dec 20, 2023
2 parents 97eafd9 + bbfff0a commit 285a44a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/objective-c-xcode.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 285a44a

Please sign in to comment.