Build iOS #9
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: Build iOS | |
on: workflow_dispatch | |
jobs: | |
ios-template: | |
name: Compiling for iOS | |
runs-on: "macos-latest" | |
strategy: | |
matrix: | |
GODOT_VERSIONS: [4.1, 4.1.1, 4.1.2, 4.1.3, 4.2, 4.2.1] | |
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: Download and unzip Stable Godot extracted headers | |
run: | | |
./scripts/download_godot.sh ${{env.CURRENT_GODOT_VERSION}} | |
- name: Generate headers | |
run: | | |
echo "Major version: $major_version" | |
./scripts/generate_headers.sh || true | |
- name: Compiles the Source Code | |
env: | |
SCONS_CACHE: ${{github.workspace}}/godot-${{env.CURRENT_GODOT_VERSION}}-stable/.scons_cache/ | |
run: | | |
./scripts/release_static_library.sh | |
- name: Compress the binaries | |
run: | | |
./scripts/create_zip.sh ${{env.CURRENT_GODOT_VERSION}} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: bin/release/poing-godot-admob-ios-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: bin/release/poing-godot-admob-ios-v${{env.CURRENT_GODOT_VERSION}}.zip | |
tag: ${{env.PLUGIN_VERSION}} | |
overwrite: true |