Versions fix #44
Workflow file for this run
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
name: Xcode - Build and Export | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Build and export default scheme using xcodebuild command | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set Build Number | |
run: | | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion Build $GITHUB_RUN_NUMBER" "PlutoHelperAgent/Info.plist" | |
- name: Test | |
run: | | |
xcodebuild test -project PlutoHelperAgent.xcodeproj -scheme PlutoHelperAgent -destination 'platform=OS X,arch=x86_64' | |
- name: Build | |
run: | | |
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}'` | |
mkdir $PWD/build | |
xcodebuild clean archive -archivePath $PWD/build/Build.xcarchive -scheme PlutoHelperAgent -"$filetype_parameter" "$file_to_build" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Export Executable | |
run: | | |
mkdir $PWD/application | |
xcodebuild -exportArchive -archivePath $PWD/build/Build.xcarchive -exportOptionsPlist $PWD/ExportOptions.plist -exportPath $PWD/application/ | |
- name: Package Executable | |
run: | | |
mkdir $PWD/package | |
pkgbuild --install-location /Applications --component $PWD/application/PlutoHelperAgent.app $PWD/package/PlutoHelperAgent.pkg | |
- name: Upload Package | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: PlutoHelperAgent-${{ github.run_number }} | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ./package/ | |
# The desired behavior if no files are found using the provided path. | |
if-no-files-found: error |