-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
122 lines (108 loc) · 4.49 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: 'Godot iOS Upload'
description: 'Godot Engine 3.x and 4.x for iOS export and Testflight upload'
author: 'Simon Dalvai @dulvui'
branding:
color: white
icon: upload-cloud
inputs:
working-directory:
description: 'The working directory'
required: false
default: '.'
godot-version:
description: 'Godot Engine version. Supported are 4.x versions'
required: true
godot-channel:
description: 'Godot Engine release channel (stable, beta, rc1, rc2, rc3...). Defaults to stable'
required: false
default: 'stable'
project-name:
description: 'Project name used for xarchive building'
required: true
provision-profile-path:
description: 'Path of a valid provision profile file'
required: true
apple-id-password:
description: 'Apple ID password'
required: true
apple-id-username:
description: 'Apple ID username'
required: true
runs:
using: "composite"
steps:
- name: Check is running on mac-os
if: runner.os != 'macos'
shell: bash
run: exit 1
- name: Cache Godot files
id: cache-godot
uses: actions/cache@v3
with:
path: |
Godot.app
/Users/runner/Library/Application\ Support/Godot/
key: ${{ runner.os }}-godot-${{ inputs.godot-version }}-${{ inputs.godot-channel }}
- name: Download and config Godot Engine linux server and templates
shell: bash
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.godot-version }}-${{ inputs.godot-channel}}/Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel}}_macos.universal.zip
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ inputs.godot-version }}-${{ inputs.godot-channel}}/Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel}}_export_templates.tpz
unzip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel}}_macos.universal.zip
unzip Godot_v${{ inputs.godot-version }}-${{ inputs.godot-channel}}_export_templates.tpz
mkdir -p ~/Library/Application\ Support/Godot/export_templates/${{ inputs.godot-version }}.${{ inputs.godot-channel}}
mv templates/* ~/Library/Application\ Support/Godot/export_templates/${{ inputs.godot-version }}.${{ inputs.godot-channel}}
- name: Install coreutils for gtimeout
shell: bash
run: brew install coreutils
- name: Open project once to import assets
shell: bash
continue-on-error: true # timeout will exit with code 124
run: gtimeout 60 ./Godot.app/Contents/MacOS/Godot --headless --path ${{ inputs.working-directory }} -e
- name: Godot iOS export
shell: bash
run: ./Godot.app/Contents/MacOS/Godot --headless --path ${{ inputs.working-directory }} --export-release iOS
- name: Extract Provisioning profile UUID and create PP_UUID env variable
shell: bash
run: echo "PP_UUID=$(grep -a -A 1 'UUID' ${{ inputs.provision-profile-path }} | grep string | sed -e "s|<string>||" -e "s|</string>||" | tr -d '\t')" >> $GITHUB_ENV
- name: Resolve package dependencies
shell: bash
run: xcodebuild -resolvePackageDependencies
- name: Build the xarchive
shell: bash
run: |
set -eo pipefail
xcodebuild clean archive \
-scheme ${{ inputs.project-name }} \
-configuration "Release" \
-sdk iphoneos \
-archivePath "$PWD/build/${{ inputs.project-name }}.xcarchive" \
-destination "generic/platform=iOS,name=Any iOS Device" \
OTHER_CODE_SIGN_FLAGS="--keychain $RUNNER_TEMP/app-signing.keychain-db" \
CODE_SIGN_STYLE=Manual \
PROVISIONING_PROFILE=$PP_UUID \
CODE_SIGN_IDENTITY="Apple Distribution"
- name: Export .ipa
shell: bash
run: |
set -eo pipefail
xcodebuild -archivePath "$PWD/build/${{ inputs.project-name }}.xcarchive" \
-exportOptionsPlist exportOptions.plist \
-exportPath $PWD/build \
-allowProvisioningUpdates \
-exportArchive
- name: Publish the App on TestFlight
shell: bash
if: success()
env:
APPLEID_USERNAME: ${{ inputs.apple-id-username }}
APPLEID_PASSWORD: ${{ inputs.apple-id-password }}
run: |
xcrun altool \
--upload-app \
-t ios \
-f $PWD/build/*.ipa \
-u "${{ inputs.apple-id-username }}" \
-p "${{ inputs.apple-id-password }}" \
--verbose