Skip to content

Commit c1f81b9

Browse files
authored
Create workflow for builds
1 parent d127d76 commit c1f81b9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/build_app.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build_app
2+
3+
on:
4+
push:
5+
tags: [ develop ]
6+
7+
jobs:
8+
master_deploy:
9+
runs-on: macos-latest
10+
11+
steps:
12+
- name: Checkout project
13+
uses: actions/checkout@v2
14+
15+
- name: Find first scheme of default project
16+
run: |
17+
echo "::set-env name=SCHEME::$(xcodebuild -list -json | jq -r '.project.schemes[0]')"
18+
19+
- name: Set environment variables from project settings
20+
run: |
21+
function set-env-from-proj {
22+
echo "::set-env name=$1::$(xcodebuild -scheme "$SCHEME" -showBuildSettings | grep " $1 " | sed "s/[ ]*$1 = //")"
23+
}
24+
set-env-from-proj FULL_PRODUCT_NAME
25+
set-env-from-proj INSTALL_PATH
26+
set-env-from-proj PRODUCT_BUNDLE_IDENTIFIER
27+
set-env-from-proj PRODUCT_MODULE_NAME
28+
set-env-from-proj PRODUCT_NAME
29+
set-env-from-proj PROJECT_NAME
30+
31+
- name: Build and install app
32+
shell: bash
33+
run: |
34+
xcodebuild -scheme "$SCHEME" install DSTROOT=build/root | xcpretty
35+
36+
- name: Package app
37+
run: |
38+
hdiutil create \
39+
-fs HFS+ \
40+
-srcfolder "build/root/$INSTALL_PATH/$FULL_PRODUCT_NAME" \
41+
-volname "$PRODUCT_NAME" "build/$PRODUCT_MODULE_NAME.dmg"
42+
43+
- name: Upload a Build Artifact
44+
uses: actions/[email protected]
45+
with:
46+
path: build/${{ env.PRODUCT_MODULE_NAME }}.dmg

0 commit comments

Comments
 (0)