Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions .github/workflows/extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
LC_ALL: en_US.UTF-8
PYTHONIOENCODING: utf8
GODOT_VERSION_4: ${{ inputs.godot_tag }}
KEYCHAIN_PATH: app-signing.keychain-db

concurrency:
group: ci-scons-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}
Expand All @@ -35,15 +36,15 @@ jobs:
platform: windows

- name: 🍎 macOS (universal)
os: macos-15
os: macos-latest
platform: macos

- name: 🤖 Android (arm64)
os: ubuntu-latest
platform: android

- name: 🍏 iOS (arm64)
os: macos-15
os: macos-latest
platform: ios

- name: 🌐 Web (wasm32)
Expand Down Expand Up @@ -73,21 +74,58 @@ jobs:
platform: ${{ matrix.platform }}
os: ${{ matrix.os }}

- name: Retrieve the secret and decode it to a file
if: matrix.platform == 'macos' || matrix.platform == 'ios'
env:
DEV_CERT_APPLICATION: ${{ secrets.DEV_CERT_APPLICATION }}
DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }}
KC_PASS: ${{ secrets.KC_PASS }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12

# import certificate and provisioning profile from secrets
echo -n "$DEV_CERT_APPLICATION" | base64 --decode > $CERTIFICATE_PATH

# create temporary keychain
security create-keychain -p "$KC_PASS" ${{ env.KEYCHAIN_PATH }}
security set-keychain-settings -lut 21600 ${{ env.KEYCHAIN_PATH }}
security unlock-keychain -p "$KC_PASS" ${{ env.KEYCHAIN_PATH }}

# import certificate to keychain
security import $CERTIFICATE_PATH -P "$DEV_CERT_PASS" -f pkcs12 -k ${{ env.KEYCHAIN_PATH }} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS" ${{ env.KEYCHAIN_PATH }}
security list-keychain -d user -s ${{ env.KEYCHAIN_PATH }}

- name: build Linux
if: matrix.platform == 'linux'
run: |
./scripts/release-gdextension-linux.sh

- name: build macOS
if: matrix.platform == 'macos'
env:
DEV_ID_APPLICATION: ${{ secrets.DEV_ID_APPLICATION }}
run: |
./scripts/release-gdextension-macos.sh

for f in ./bin/macos/*.framework
do
codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp
done

- name: build iOS
if: matrix.platform == 'ios'
env:
DEV_ID_APPLICATION: ${{ secrets.DEV_ID_APPLICATION }}
run: |
./scripts/release-gdextension-ios.sh

for f in ./bin/ios/*.framework
do
codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp
done

- name: build Android
if: matrix.platform == 'android'
run: |
Expand All @@ -113,7 +151,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: extension-${{ matrix.platform }}-${{ steps.commit.outputs.short }}
name: extension-${{ env.GODOT_VERSION_4 }}-${{ matrix.platform }}-${{ steps.commit.outputs.short }}
path: bin/
if-no-files-found: error

Expand All @@ -140,17 +178,17 @@ jobs:
mkdir -p bin
cp ../misc/ssplayer_godot_extension.gdextension bin/

mv extension-android-${{ steps.commit.outputs.short }}/android bin/
mv extension-ios-${{ steps.commit.outputs.short }}/ios bin/
mv extension-macos-${{ steps.commit.outputs.short }}/macos bin/
mv extension-web-${{ steps.commit.outputs.short }}/web bin/
mv extension-windows-${{ steps.commit.outputs.short }}/windows bin/
# mv extension-linux-${{ steps.commit.outputs.short }}/linux bin/
mv extension-${{ env.GODOT_VERSION_4 }}-android-${{ steps.commit.outputs.short }}/android bin/
mv extension-${{ env.GODOT_VERSION_4 }}-ios-${{ steps.commit.outputs.short }}/ios bin/
mv extension-${{ env.GODOT_VERSION_4 }}-macos-${{ steps.commit.outputs.short }}/macos bin/
mv extension-${{ env.GODOT_VERSION_4 }}-web-${{ steps.commit.outputs.short }}/web bin/
mv extension-${{ env.GODOT_VERSION_4 }}-windows-${{ steps.commit.outputs.short }}/windows bin/
# mv extension-${{ env.GODOT_VERSION_4 }}-linux-${{ steps.commit.outputs.short }}/linux bin/

zip -r ../ssplayer-godot-extension-${{ steps.commit.outputs.short }}.zip ssplayer_godot_extension.gdextension bin/
zip -r ../ssplayer-godot-extension-${{ env.GODOT_VERSION_4 }}-${{ steps.commit.outputs.short }}.zip bin/

- name: Upload final release package
uses: actions/upload-artifact@v4
with:
name: ssplayer-godot-extension-${{ steps.commit.outputs.short }}
path: ssplayer-godot-extension-${{ steps.commit.outputs.short }}.zip
name: ssplayer-godot-extension-${{ env.GODOT_VERSION_4 }}-${{ steps.commit.outputs.short }}
path: ssplayer-godot-extension-${{ env.GODOT_VERSION_4 }}-${{ steps.commit.outputs.short }}.zip
58 changes: 52 additions & 6 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ソース取得

本リポジトリをクローンしてください
本リポジトリをクローンして、 `SSPlayerForGodot` ディレクトリ内に入ってください

```bash
git clone --recursive https://github.com/SpriteStudio/SSPlayerForGodot.git
Expand All @@ -20,10 +20,10 @@ git clone https://github.com/godotengine/godot-cpp.git
```

# ブランチ選択
## Godot
SSPlayerForGodot ディレクトリの `godot` ディレクトリ内でビルドする Godot Engine のブランチを選択してください。

## Godot
### 4.4
### 4

```bash
pushd godot
Expand All @@ -50,10 +50,11 @@ popd
```

# ビルド環境のセットアップ
## Windows

以降でビルド環境の構築手順について説明していきます。

## Windows

[Godot公式のコンパイル手順](https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_windows.html)

必要なツール
Expand Down Expand Up @@ -101,12 +102,21 @@ brew install molten-vk
brew install emscripten
```

(Optional) target を Android のビルドをする際は Android NDK をインストールしてください。


## Linux
T.B.D

# ビルド
## Windows
### 4

[build.ps1](./scripts/build.ps1) でビルド可能です。


成果物は `godot\bin` に格納されます。

**PowerShell**

```powershell
Expand All @@ -124,6 +134,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build.ps1
### 3.x

[build-v3.ps1](./scripts/build-v3.ps1) でビルド可能です。
成果物は `godot\bin` に格納されます。

**PowerShell**

Expand All @@ -144,6 +155,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-v3.ps1
### 4

[build.sh](./scripts/build.sh) でビルド可能です。
成果物は `godot/bin` に格納されます。

```sh
./scripts/build.sh
Expand Down Expand Up @@ -175,6 +187,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-v3.ps1
### 3.x

[build-v3.sh](./scripts/build-v3.sh) でビルド可能です。
成果物は `godot/bin` に格納されます。

```sh
./scripts/build-v3.sh
Expand Down Expand Up @@ -207,6 +220,8 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-v3.ps1
# GDExtension
## Windows
[build-extension.ps1](./scripts/build-extension.ps1) でビルド可能です。
成果物は `bin` ディレクトリに格納されます。


**PowerShell**

Expand All @@ -227,6 +242,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-extension.ps1
macOS か Linux で実行してください。

[build-extension.sh](./scripts/build-extension.sh) でビルド可能です。
成果物は `bin` ディレクトリに格納されます。

```sh
./scripts/build-extension.sh
Expand All @@ -236,10 +252,40 @@ macOS か Linux で実行してください。
# リリースビルド
## 4

...
各プラットフォームの godot の `editor`, `template_debug`, `template_release` をまとめてビルドスクリプトは下記の通りです。

windows
```
.\scripts\release-windows.ps1
```

macOS
```sh
./scripts/release-macos.sh
```

Linux
```sh
./scripts/release-linux.sh
```

iOS
```sh
./scripts/release-ios.sh
```

Android
```sh
./scripts/release-android.sh
```

Web
```sh
./scripts/release-web.sh
```

## GDExtension
各プラットフォームの gdextension の editor, template_debug, template_release をまとめてビルドスクリプトは下記の通りです。
各プラットフォームの gdextension の `editor`, `template_debug`, `template_release` をまとめてビルドスクリプトは下記の通りです。

windows
```
Expand Down
Loading
Loading