Skip to content

Commit

Permalink
Faeture/81 build macos release in ci (#82)
Browse files Browse the repository at this point in the history
* Building macOS release on work branches

* Okey will build mac in the future
  • Loading branch information
kamaal111 authored Sep 24, 2022
1 parent 8ac0800 commit 7f39f48
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 20 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
submodules: recursive

- name: Setup - Xcode
env:
XCODE_APP_NAME: Xcode_14.0.app
run: |
sh Scripts/select_xcode_version.sh
Expand All @@ -50,8 +52,37 @@ jobs:
run: |
yarn build:ios:release
test:
name: Test
# buildMacOSRelease:
# name: Build macOS release
# timeout-minutes: 15
# runs-on: macos-12
# needs: [quality]
# if: contains(github.ref, 'refs/heads/release/') == false && github.ref != 'refs/heads/main'
# steps:
# - name: Git - Checkout
# uses: actions/checkout@v2
# with:
# ref: ${{ github.ref }}
# submodules: recursive

# - name: Setup - Xcode
# env:
# XCODE_APP_NAME: Xcode_14.1.app
# run: |
# sh Scripts/select_xcode_version.sh

# - name: Create token file
# run: |
# # No need to actually add the tokens in the test

# yarn generate-tokens

# - name: Build
# run: |
# yarn build:mac:release

testIOS:
name: Test iOS
timeout-minutes: 15
runs-on: macos-12
needs: [quality]
Expand All @@ -63,6 +94,8 @@ jobs:
submodules: recursive

- name: Setup - Xcode
env:
XCODE_APP_NAME: Xcode_14.0.app
run: |
sh Scripts/select_xcode_version.sh
Expand All @@ -80,7 +113,7 @@ jobs:
name: Deploy iOS
timeout-minutes: 15
runs-on: macos-12
needs: [test]
needs: [testIOS]
if: contains(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/main'
steps:
- name: Git - Checkout
Expand All @@ -105,6 +138,8 @@ jobs:
bash Scripts/import_provisioning_profile_ios.bash
- name: Setup - Xcode
env:
XCODE_APP_NAME: Xcode_14.0.app
run: |
sh Scripts/select_xcode_version.sh
Expand Down
32 changes: 32 additions & 0 deletions Scripts/build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

# build_release.sh
# Tasktive
#
# Created by Kamaal M Farah on 15/09/2022.
#

PROJECT="Tasktive.xcodeproj"

if [[ ! -n $SCHEME ]]
then
echo $SCHEME
echo "No scheme provided"
exit 1
fi

if [[ ! -n $DESTINATION ]]
then
if [[ $SCHEME == "Tasktive" ]]
then
DESTINATION="platform=iOS Simulator,name=iPhone 14 Pro Max"
elif [[ $SCHEME == "TasktiveMac" ]]
then
DESTINATION="platform=macOS"
else
echo "Invalid scheme provided"
exit 1
fi
fi

set -o pipefail && xcodebuild -configuration Release -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" || exit 1
13 changes: 0 additions & 13 deletions Scripts/release_build_ios.sh

This file was deleted.

2 changes: 1 addition & 1 deletion Scripts/select_xcode_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
echo "listing available Xcode versions:"
ls -d /Applications/Xcode*

sudo xcode-select --switch /Applications/Xcode_14.0.app/Contents/Developer
sudo xcode-select --switch /Applications/$XCODE_APP_NAME/Contents/Developer
4 changes: 2 additions & 2 deletions Tasktive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
2C69A04928B1932F00D5006D /* CoreDataViewerScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataViewerScreen.swift; sourceTree = "<group>"; };
2C69A04C28B193CB00D5006D /* PlaygroundNavigationButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaygroundNavigationButton.swift; sourceTree = "<group>"; };
2C69A0B328B19BC600D5006D /* TasktiveMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TasktiveMac.app; sourceTree = BUILT_PRODUCTS_DIR; };
2C717E7B28D3B09E00DC060D /* release_build_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = release_build_ios.sh; sourceTree = "<group>"; };
2C717E7B28D3B09E00DC060D /* build_release.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = build_release.sh; sourceTree = "<group>"; };
2C750F65288C2F9400026D67 /* CircularProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircularProgressBar.swift; sourceTree = "<group>"; };
2C750F67288C31CF00026D67 /* ProgressSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressSection.swift; sourceTree = "<group>"; };
2C750F69288C328C00026D67 /* TasksSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TasksSection.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1039,9 +1039,9 @@
2CBD454F28CE02610073E317 /* import_signing_certificate_ios.bash */,
2C33AD7028CFACA100E77F8D /* archive_ios.sh */,
2CE0C86C28A8621200B54EC9 /* bootstrap.sh */,
2C717E7B28D3B09E00DC060D /* build_release.sh */,
2C07056028A0393E0058F646 /* clear_mac_data.sh */,
2CCCADAD2881F1CC0033E2EF /* pre_compile.sh */,
2C717E7B28D3B09E00DC060D /* release_build_ios.sh */,
2CD2EB7728BA41F500C14B18 /* run_ios_tests.sh */,
2CAFF5D828CDD4FC00D4E91E /* select_xcode_version.sh */,
2C98E3CC28B12DFB0048149F /* app-icon-generator */,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"bump-version": "go run Scripts/xcode-app-version-bumper/*go",
"format": "swiftformat .",
"archive:ios:ci": "sh Scripts/archive_ios.sh",
"build:ios:release": "sh Scripts/release_build_ios.sh"
"build:ios:release": "SCHEME=Tasktive sh Scripts/build_release.sh",
"build:mac:release": "SCHEME=TasktiveMac sh Scripts/build_release.sh"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 7f39f48

Please sign in to comment.