-
-
Notifications
You must be signed in to change notification settings - Fork 18
executable file
·157 lines (132 loc) · 5.64 KB
/
release_ios.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build iOS 3.3+
on: workflow_dispatch
jobs:
download-google-mobile-ads-sdk:
name: Download Google Mobile Ads SDK
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set plugin version on env
run: |
PLUGIN_VERSION=$(find . -name "*.h" -exec grep -H 'PLUGIN_VERSION = ' {} \; | awk -F'"' '{print $2}')
echo "PLUGIN_VERSION=v${PLUGIN_VERSION}" >> $GITHUB_ENV
- name: Download, copy and unzip the lastest Google Mobile Ads SDK on release binaries and iOS module folder
run: |
curl -LO https://dl.google.com/googleadmobadssdk/googlemobileadssdkios.zip
- name: Upload Google Mobile Ads SDK as Artifact
uses: actions/upload-artifact@v2
with:
name: googlemobileadssdkios.zip
path: googlemobileadssdkios.zip
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
target_commit: ${{ github.ref_name }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: googlemobileadssdkios.zip
tag: ${{env.PLUGIN_VERSION}}
overwrite: true
ios-template:
needs: [download-google-mobile-ads-sdk]
name: Compiling for iOS
runs-on: "macos-latest"
strategy:
matrix:
GODOT_VERSIONS: [3.3, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.5, 3.5.1, 3.5.2, 3.5.3, 4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.1, 4.1.1, 4.1.2]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set plugin version on env
run: |
PLUGIN_VERSION=$(find . -name "*.h" -exec grep -H 'PLUGIN_VERSION = ' {} \; | awk -F'"' '{print $2}')
echo "PLUGIN_VERSION=v${PLUGIN_VERSION}" >> $GITHUB_ENV
# Github Actions Matrix doesnt support x.0 values, it's replaced by ''
- name: Verify current matrix's GODOT_VERSIONS
run: |
CURRENT_GODOT_VERSION=${{matrix.GODOT_VERSIONS}}
if [ ${#CURRENT_GODOT_VERSION} -eq 1 ]; then CURRENT_GODOT_VERSION="${CURRENT_GODOT_VERSION}.0"; fi
echo "CURRENT_GODOT_VERSION=${CURRENT_GODOT_VERSION}" >> $GITHUB_ENV
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
id: ios-template-cache
uses: actions/cache@v2
with:
path: ${{github.workspace}}/godot-${{env.CURRENT_GODOT_VERSION}}-stable/.scons_cache/
key: ${{github.job}}-master-${{github.ref}}-${{github.sha}}
restore-keys: |
${{github.job}}-master-${{github.ref}}-${{github.sha}}
${{github.job}}-master-${{github.ref}}
${{github.job}}-master
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Prepare 'bin/, lib/, godot' folders
run: |
rm -rf ./bin/ && mkdir ./bin/
rm -rf ./plugin/admob/lib/ && mkdir ./plugin/admob/lib/
- name: Download and unzip Stable Godot extracted headers
run: |
FULL_PATHNAME_DOWNLOAD_GODOT_EXTRACTED_HEADERS="https://github.com/godotengine/godot/releases/download/${{env.CURRENT_GODOT_VERSION}}-stable/godot-${{env.CURRENT_GODOT_VERSION}}-stable.tar.xz"
curl -LO $FULL_PATHNAME_DOWNLOAD_GODOT_EXTRACTED_HEADERS
tar -xf godot-${{env.CURRENT_GODOT_VERSION}}-stable.tar.xz
mv godot-${{env.CURRENT_GODOT_VERSION}}-stable godot
- name: Generate headers
run: |
if [[ ${{env.CURRENT_GODOT_VERSION}} =~ ^3\..* ]]; then
major_version=$(echo ${{env.CURRENT_GODOT_VERSION}} | sed -E 's/^([0-9]+)\..*$/\1.x/g')
else
major_version=${{env.CURRENT_GODOT_VERSION}}
fi
echo "Major version: $major_version"
./scripts/generate_headers.sh ${major_version} || true
- name: Download Google Mobile Ads SDK Artifact
uses: actions/download-artifact@v2
with:
name: googlemobileadssdkios.zip
- name: Copy and unzip the Google Mobile Ads SDK on release binaries and iOS module folder
run: |
mkdir -p godot-${{env.CURRENT_GODOT_VERSION}}-stable/bin/release/
unzip googlemobileadssdkios.zip -d plugin/admob/lib/
cd plugin/admob/lib/
cd */
mv * ../
- name: Compiles the Source Code
env:
SCONS_CACHE: ${{github.workspace}}/godot-${{env.CURRENT_GODOT_VERSION}}-stable/.scons_cache/
run: |
VERSION_TO_BUILD=${CURRENT_GODOT_VERSION:0:1}.x
./scripts/release_static_library.sh ${VERSION_TO_BUILD}
- name: Compress the binaries
run: |
if [ 1 -eq "$(echo "${CURRENT_GODOT_VERSION:0:3} < 3.4" | bc)" ]
then
cp ./plugin/admob/config/3.3\<3.4/admob.gdip ./bin/release/admob
fi
cd bin/release
zip -r ../../ios-template-v${{env.CURRENT_GODOT_VERSION}}.zip admob
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ios-template-v${{env.CURRENT_GODOT_VERSION}}.zip
path: ios-template-v${{env.CURRENT_GODOT_VERSION}}.zip
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
target_commit: ${{ github.ref_name }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ios-template-v${{env.CURRENT_GODOT_VERSION}}.zip
tag: ${{env.PLUGIN_VERSION}}
overwrite: true