From 6534667863b67e633c84e3bab6ba9d655f972886 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 11 Aug 2025 15:16:21 +0900 Subject: [PATCH 01/22] codesign macOS and iOS libraries. --- .github/actions/setup-codesign/action.yml | 35 ++++++++++++++++++++++ .github/actions/setup-extension/action.yml | 5 ++++ .github/workflows/extension.yml | 14 +++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/actions/setup-codesign/action.yml diff --git a/.github/actions/setup-codesign/action.yml b/.github/actions/setup-codesign/action.yml new file mode 100644 index 0000000..571f0f6 --- /dev/null +++ b/.github/actions/setup-codesign/action.yml @@ -0,0 +1,35 @@ +name: Setup codesign +description: Setup codesin + +inputs: + platform: + required: true + description: Target platform. + +runs: + using: composite + steps: + - name: Retrieve the secret and decode it to a file + if: inputs.platform == 'macOS' || inputs.platform == 'iOS' + env: + DEV_CERT_APP2: ${{ secrets.DEV_CERT_APP2 }} + DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }} + KC_PASS: ${{ secrets.KC_PASS }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + KEYCHAIN_PATH=app-signing.keychain-db + echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> $GITHUB_ENV + + # import certificate and provisioning profile from secrets + echo -n "$DEV_CERT_APP2" | base64 --decode > $CERTIFICATE_PATH + + # create temporary keychain + security create-keychain -p "$KC_PASS" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KC_PASS" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$DEV_CERT_PASS" -f pkcs12 -k $KEYCHAIN_PATH -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS" $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH diff --git a/.github/actions/setup-extension/action.yml b/.github/actions/setup-extension/action.yml index 5306459..f116836 100644 --- a/.github/actions/setup-extension/action.yml +++ b/.github/actions/setup-extension/action.yml @@ -32,3 +32,8 @@ runs: uses: mymindstorm/setup-emsdk@v14 with: no-cache: true + + - name: setup codesign + uses: ./.github/actions/setup-codesign + with: + platform: ${{ inputs.platform }} diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index dfcc496..9dc2448 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -80,14 +80,28 @@ jobs: - 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/macos.framework/* + do + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --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 $(find ./bin/ios -name '*.dylib') + do + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp + done + - name: build Android if: matrix.platform == 'android' run: | From 800a7869253f4cd8eb454fcf06fb05cc7eef2f21 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 11 Aug 2025 19:55:42 +0900 Subject: [PATCH 02/22] move prepare of codesign from actions to workflows. --- .github/actions/setup-codesign/action.yml | 35 ---------------------- .github/actions/setup-extension/action.yml | 5 ---- .github/workflows/extension.yml | 25 ++++++++++++++++ 3 files changed, 25 insertions(+), 40 deletions(-) delete mode 100644 .github/actions/setup-codesign/action.yml diff --git a/.github/actions/setup-codesign/action.yml b/.github/actions/setup-codesign/action.yml deleted file mode 100644 index 571f0f6..0000000 --- a/.github/actions/setup-codesign/action.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Setup codesign -description: Setup codesin - -inputs: - platform: - required: true - description: Target platform. - -runs: - using: composite - steps: - - name: Retrieve the secret and decode it to a file - if: inputs.platform == 'macOS' || inputs.platform == 'iOS' - env: - DEV_CERT_APP2: ${{ secrets.DEV_CERT_APP2 }} - DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }} - KC_PASS: ${{ secrets.KC_PASS }} - run: | - # create variables - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - KEYCHAIN_PATH=app-signing.keychain-db - echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> $GITHUB_ENV - - # import certificate and provisioning profile from secrets - echo -n "$DEV_CERT_APP2" | base64 --decode > $CERTIFICATE_PATH - - # create temporary keychain - security create-keychain -p "$KC_PASS" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KC_PASS" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$DEV_CERT_PASS" -f pkcs12 -k $KEYCHAIN_PATH -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS" $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH diff --git a/.github/actions/setup-extension/action.yml b/.github/actions/setup-extension/action.yml index f116836..5306459 100644 --- a/.github/actions/setup-extension/action.yml +++ b/.github/actions/setup-extension/action.yml @@ -32,8 +32,3 @@ runs: uses: mymindstorm/setup-emsdk@v14 with: no-cache: true - - - name: setup codesign - uses: ./.github/actions/setup-codesign - with: - platform: ${{ inputs.platform }} diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 9dc2448..cf54f8d 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -73,6 +73,31 @@ 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_APP2: ${{ secrets.DEV_CERT_APP2 }} + DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }} + KC_PASS: ${{ secrets.KC_PASS }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + KEYCHAIN_PATH=app-signing.keychain-db + echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> $GITHUB_ENV + + # import certificate and provisioning profile from secrets + echo -n "$DEV_CERT_APP2" | base64 --decode > $CERTIFICATE_PATH + + # create temporary keychain + security create-keychain -p "$KC_PASS" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KC_PASS" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$DEV_CERT_PASS" -f pkcs12 -k $KEYCHAIN_PATH -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS" $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + - name: build Linux if: matrix.platform == 'linux' run: | From 6d12909184789b44ae928344e1758ff1f3a689b3 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 11 Aug 2025 20:12:14 +0900 Subject: [PATCH 03/22] fix ssplayer_godot_extension.gdextension. --- misc/ssplayer_godot_extension.gdextension | 29 +++++++---------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/misc/ssplayer_godot_extension.gdextension b/misc/ssplayer_godot_extension.gdextension index 84a34f9..da8991c 100644 --- a/misc/ssplayer_godot_extension.gdextension +++ b/misc/ssplayer_godot_extension.gdextension @@ -1,7 +1,7 @@ [configuration] entry_symbol = "spritestudio_godot_library_init" -compatibility_minimum = "4.3" +compatibility_minimum = "4.4" [libraries] @@ -9,32 +9,21 @@ macos.editor = "res://bin/macos/macos.framework/libSSGodot.macos.editor" macos.debug = "res://bin/macos/macos.framework/libSSGodot.macos.template_debug" macos.release = "res://bin/macos/macos.framework/libSSGodot.macos.template_release" -ios.debug = "res://bin/ios/ios.framework/libSSGodot.ios.template_debug.xcframework" -ios.release = "res://bin/ios/ios.framework/libSSGodot.ios.template_release.xcframework" +ios.debug = "res://bin/ios/libSSGodot.ios.template_debug.xcframework" +ios.release = "res://bin/ios/libSSGodot.ios.template_release.xcframework" -windows.editor.x86_64 = "res://bin/windows/libSSGodot.windows.editor.x86_64.dll" -windows.debug.x86_64 = "res://bin/windows/libSSGodot.windows.template_debug.x86_64.dll" -windows.release.x86_64 = "res://bin/windows/libSSGodot.windows.template_release.x86_64.dll" - -linux.editor.x86_64 = "res://bin/linux/libSSGodot.linux.editor.x86_64.so" -linux.debug.x86_64 = "res://bin/linux/libSSGodot.linux.template_debug.x86_64.so" -linux.release.x86_64 = "res://bin/linux/libSSGodot.linux.template_release.x86_64.so" - -linux.editor.arm64 = "res://bin/linux/libSSGodot.linux.editor.arm64.so" -linux.debug.arm64 = "res://bin/linux/libSSGodot.linux.template_debug.arm64.so" -linux.release.arm64 = "res://bin/linux/libSSGodot.linux.template_release.arm64.so" - -linux.editor.rv64 = "res://bin/linux/libSSGodot.linux.editor.rv64.so" -linux.debug.rv64 = "res://bin/linux/libSSGodot.linux.template_debug.rv64.so" -linux.release.rv64 = "res://bin/linux/libSSGodot.linux.template_release.rv64.so" +windows.editor.x86_64 = "res://bin/windows/SSGodot.windows.editor.x86_64.dll" +windows.debug.x86_64 = "res://bin/windows/SSGodot.windows.template_debug.x86_64.dll" +windows.release.x86_64 = "res://bin/windows/SSGodot.windows.template_release.x86_64.dll" android.debug.x86_64 = "res://bin/android/libSSGodot.android.template_debug.x86_64.so" android.release.x86_64 = "res://bin/android/libSSGodot.android.template_release.x86_64.so" +android.debug.arm32 = "res://bin/android/libSSGodot.android.template_debug.arm32.so" +android.release.arm32 = "res://bin/android/libSSGodot.android.template_release.arm32.so" + android.debug.arm64 = "res://bin/android/libSSGodot.android.template_debug.arm64.so" android.release.arm64 = "res://bin/android/libSSGodot.android.template_release.arm64.so" web.debug.threads.wasm32 = "res://bin/web/libSSGodot.web.template_debug.wasm32.wasm" web.release.threads.wasm32 = "res://bin/web/libSSGodot.web.template_release.wasm32.wasm" -web.debug.wasm32 = "res://bin/web/libSSGodot.web.template_debug.wasm32.nothreads.wasm" -web.release.wasm32 = "res://bin/web/libSSGodot.web.template_release.wasm32.nothreads.wasm" \ No newline at end of file From 8cded6d7eb01f5eb2367ef9110a387fdc34fa3a0 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 11 Aug 2025 20:28:00 +0900 Subject: [PATCH 04/22] fix keychain veriable --- .github/workflows/extension.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index cf54f8d..40f4df9 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -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 }} @@ -82,21 +83,19 @@ jobs: run: | # create variables CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - KEYCHAIN_PATH=app-signing.keychain-db - echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> $GITHUB_ENV # import certificate and provisioning profile from secrets echo -n "$DEV_CERT_APP2" | base64 --decode > $CERTIFICATE_PATH # create temporary keychain - security create-keychain -p "$KC_PASS" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KC_PASS" $KEYCHAIN_PATH + 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 $KEYCHAIN_PATH -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KC_PASS" $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH + 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' From e478fe249bc7a08b7301eee3feea1e342216e907 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 11 Aug 2025 20:28:30 +0900 Subject: [PATCH 05/22] add godot version to artifact files. --- .github/workflows/extension.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 40f4df9..a4b88ef 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -151,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 @@ -178,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 From 942de2309e542b5de95c1100c73058715b5f9c99 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 13 Aug 2025 14:28:21 +0900 Subject: [PATCH 06/22] fix --- .github/workflows/extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index a4b88ef..920f6f7 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -75,7 +75,7 @@ jobs: os: ${{ matrix.os }} - name: Retrieve the secret and decode it to a file - if: matrix.platform == 'macOS' || matrix.platform == 'iOS' + if: matrix.platform == 'macos' || matrix.platform == 'ios' env: DEV_CERT_APP2: ${{ secrets.DEV_CERT_APP2 }} DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }} From b801fb2f8f48c0d0febe3a17fcc8d20d65f0850c Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 13 Aug 2025 14:28:33 +0900 Subject: [PATCH 07/22] update --- BUILD.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BUILD.md b/BUILD.md index d0c553c..71d0034 100644 --- a/BUILD.md +++ b/BUILD.md @@ -101,6 +101,13 @@ brew install molten-vk brew install emscripten ``` +(Optional) target を Android のビルドをする際は Android NDK をインストールしてください。 + + + +## Linux +T.B.D + # ビルド ## Windows ### 4 From d1f99eb1d27f157cf9d7f54479ce033ec148f0ba Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 13 Aug 2025 15:52:53 +0900 Subject: [PATCH 08/22] update secrets variables --- .github/workflows/extension.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 920f6f7..2a7ad3e 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -77,7 +77,7 @@ jobs: - name: Retrieve the secret and decode it to a file if: matrix.platform == 'macos' || matrix.platform == 'ios' env: - DEV_CERT_APP2: ${{ secrets.DEV_CERT_APP2 }} + DEV_CERT_APPLICATION: ${{ secrets.DEV_CERT_APPLICATION }} DEV_CERT_PASS: ${{ secrets.DEV_CERT_PASS }} KC_PASS: ${{ secrets.KC_PASS }} run: | @@ -85,7 +85,7 @@ jobs: CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 # import certificate and provisioning profile from secrets - echo -n "$DEV_CERT_APP2" | base64 --decode > $CERTIFICATE_PATH + echo -n "$DEV_CERT_APPLICATION" | base64 --decode > $CERTIFICATE_PATH # create temporary keychain security create-keychain -p "$KC_PASS" ${{ env.KEYCHAIN_PATH }} From 182c09e20cf4ee1f4982faec524bafe6593be0df Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 13 Aug 2025 17:55:54 +0900 Subject: [PATCH 09/22] add notarizing dylib files of macOS. --- .github/workflows/extension.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 2a7ad3e..a1394cc 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -106,6 +106,9 @@ jobs: if: matrix.platform == 'macos' env: DEV_ID_APPLICATION: ${{ secrets.DEV_ID_APPLICATION }} + APPLE_ID: ${{ secrets.APPLE_ID }} + TEAM_ID: ${{ secrets.TEAM_ID }} + NOTRIZATION_PWD: ${{ secrets.NOTARIZATION_PWD }} run: | ./scripts/release-gdextension-macos.sh @@ -114,6 +117,20 @@ jobs: codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp done + xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTRIZATION_PWD" + + echo "xcrun notarytool" + + pushd bin/macos/macos.framework + zip ../../../ssplayer_godot_extension_mac.zip ./* + popd + xcrun notarytool submit ssplayer_godot_extension_mac.zip --keychain-profile "notarytool-profile" --wait + + echo "xcrun stapler" + xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.editor" + xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.template_debug" + xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.template_release" + - name: build iOS if: matrix.platform == 'ios' env: From 15df2c6541a6ea4c03659fb5cfd183d2b1206279 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 13 Aug 2025 23:45:42 +0900 Subject: [PATCH 10/22] update build scripts. --- .github/workflows/extension.yml | 14 +++--- SConstruct | 52 +++++++++++++++++++---- misc/Info.ios.plist | 24 +++++++++++ misc/Info.macos.plist | 26 ++++++++++++ misc/ssplayer_godot_extension.gdextension | 35 ++++++++------- scripts/build-extension.sh | 12 ++---- scripts/release-gdextension-ios.sh | 26 +++++++----- scripts/release-gdextension-macos.sh | 1 + scripts/release-gdextension-web.sh | 2 +- 9 files changed, 141 insertions(+), 51 deletions(-) create mode 100644 misc/Info.ios.plist create mode 100644 misc/Info.macos.plist diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index a1394cc..ac9daa5 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -112,7 +112,7 @@ jobs: run: | ./scripts/release-gdextension-macos.sh - for f in ./bin/macos/macos.framework/* + for f in ./bin/macos/*.framework/lib* do codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp done @@ -121,15 +121,15 @@ jobs: echo "xcrun notarytool" - pushd bin/macos/macos.framework - zip ../../../ssplayer_godot_extension_mac.zip ./* + pushd bin/macos/ + zip ../../ssplayer_godot_extension_mac.zip ./* popd xcrun notarytool submit ssplayer_godot_extension_mac.zip --keychain-profile "notarytool-profile" --wait echo "xcrun stapler" - xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.editor" - xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.template_debug" - xcrun stapler staple -v "./bin/macos/macos.framework/libSSGodot.macos.template_release" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework" - name: build iOS if: matrix.platform == 'ios' @@ -138,7 +138,7 @@ jobs: run: | ./scripts/release-gdextension-ios.sh - for f in $(find ./bin/ios -name '*.dylib') + for f in ./bin/ios/*.framework/lib* do codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp done diff --git a/SConstruct b/SConstruct index 15da5e9..6921c39 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,7 @@ #!/usr/bin/env python import os import sys +import subprocess def normalize_path(val, env): return val if os.path.isabs(val) else os.path.join(env.Dir("#").abspath, val) @@ -10,6 +11,7 @@ def validate_parent_dir(key, val, env): if not os.path.isdir(normalize_path(os.path.dirname(val), env)): raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val))) + libname = "SSGodot" projectdir = os.path.join("examples", "feature_test_gdextension") @@ -34,13 +36,11 @@ opts.Add( validator=validate_parent_dir, ) ) - opts.Update(localEnv) Help(opts.GenerateHelpText(localEnv)) env = localEnv.Clone() - env["compiledb"] = False env.Tool("compilation_db") @@ -76,6 +76,10 @@ env.Append( "gd_spritestudio/SpriteStudio6-SDK/Common/Helper", ] ) +# Set iOS minimum deployment target +if env["platform"] == "ios": + env.Append(CCFLAGS=["-miphoneos-version-min=12.0"]) + env.Append(LINKFLAGS=["-miphoneos-version-min=12.0"]) sources = Glob("gd_spritestudio/*.cpp") sources.extend(Glob("gd_spritestudio/SpriteStudio6-SDK/Common/Loader/tinyxml2/*.cpp")) @@ -93,12 +97,13 @@ if env["target"] in ["editor", "template_debug"]: except AttributeError: print("Not including class reference as we're targeting a pre-4.3 baseline.") -file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"]) +file = "lib{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"]) filepath = "" if env["platform"] == "macos" or env["platform"] == "ios": - filepath = "{}.framework/".format(env["platform"]) - file = "{}.{}.{}".format(libname, env["platform"], env["target"]) + filepath = "lib{}.{}.{}.framework/".format(libname, env["platform"], env["target"]) + file = "lib{}.{}.{}".format(libname, env["platform"], env["target"]) + env.Append(LINKFLAGS=["-Wl,-install_name,@rpath/{}{}".format(filepath, file)]) libraryfile = "bin/{}/{}{}".format(env["platform"], filepath, file) library = env.SharedLibrary( @@ -106,9 +111,40 @@ library = env.SharedLibrary( source=sources, ) -copy = env.InstallAs("{}/bin/{}/{}lib{}".format(projectdir, env["platform"], filepath, file), library) - +if env["platform"] == "macos" or env["platform"] == "ios": + plist_subst = { + "${BUNDLE_LIBRARY}": file, + "${BUNDLE_NAME}": "ssplayer-godot", + "${BUNDLE_IDENTIFIER}": "jp.co.cri-mw.spritestudio.ssplayer-godot", + "${BUNDLE_VERSION}": subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('utf-8').strip().split('-')[0] + '.0', + "${MIN_MACOS_VERSION}": "10.12", + "${MIN_IOS_VERSION}": "12.0" + } + + if env["platform"] == "macos": + plist_file = "bin/macos/{}Resources/Info.plist".format(filepath) + plist = env.Substfile( + target=plist_file, + source="misc/Info.macos.plist", + SUBST_DICT=plist_subst + ) + elif env["platform"] == "ios": + plist_file = "bin/ios/{}Info.plist".format(filepath) + plist = env.Substfile( + target=plist_file, + source="misc/Info.ios.plist", + SUBST_DICT=plist_subst + ) + + env.Depends(library, plist) + +copy = env.InstallAs("{}/{}".format(projectdir, libraryfile), library) default_args = [library, copy] + +if env["platform"] == "macos" or env["platform"] == "ios": + copy_plist = env.InstallAs("{}/{}".format(projectdir, plist_file), plist_file) + default_args.append(copy_plist) + if localEnv.get("compiledb", False): default_args += [compilation_db] -Default(*default_args) +Default(*default_args) \ No newline at end of file diff --git a/misc/Info.ios.plist b/misc/Info.ios.plist new file mode 100644 index 0000000..84d3d2b --- /dev/null +++ b/misc/Info.ios.plist @@ -0,0 +1,24 @@ + + + + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleExecutable + ${BUNDLE_LIBRARY} + CFBundleName + ${BUNDLE_NAME} + CFBundleIdentifier + ${BUNDLE_IDENTIFIER} + CFBundleVersion + ${BUNDLE_VERSION} + CFBundleShortVersionString + ${BUNDLE_VERSION} + MinimumOSVersion + ${MIN_IOS_VERSION} + DTPlatformName + iphoneos + + diff --git a/misc/Info.macos.plist b/misc/Info.macos.plist new file mode 100644 index 0000000..6be9410 --- /dev/null +++ b/misc/Info.macos.plist @@ -0,0 +1,26 @@ + + + + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleExecutable + ${BUNDLE_LIBRARY} + CFBundleName + ${BUNDLE_NAME} + CFBundleIdentifier + ${BUNDLE_IDENTIFIER} + CFBundleVersion + ${BUNDLE_VERSION} + CFBundleShortVersionString + ${BUNDLE_VERSION} + LSMinimumSystemVersion + ${MIN_MACOS_VERSION} + CFBundleSupportedPlatforms + + MacOSX + + + diff --git a/misc/ssplayer_godot_extension.gdextension b/misc/ssplayer_godot_extension.gdextension index da8991c..35a08ad 100644 --- a/misc/ssplayer_godot_extension.gdextension +++ b/misc/ssplayer_godot_extension.gdextension @@ -5,25 +5,28 @@ compatibility_minimum = "4.4" [libraries] -macos.editor = "res://bin/macos/macos.framework/libSSGodot.macos.editor" -macos.debug = "res://bin/macos/macos.framework/libSSGodot.macos.template_debug" -macos.release = "res://bin/macos/macos.framework/libSSGodot.macos.template_release" +macos.editor = "macos/libSSGodot.macos.editor.framework" +macos.debug = "macos/libSSGodot.macos.template_debug.framework" +macos.release = "macos/libSSGodot.macos.template_release.framework" -ios.debug = "res://bin/ios/libSSGodot.ios.template_debug.xcframework" -ios.release = "res://bin/ios/libSSGodot.ios.template_release.xcframework" +ios.debug = "ios/libSSGodot.ios.template_debug.framework" +ios.release = "ios/libSSGodot.ios.template_debug.framework" -windows.editor.x86_64 = "res://bin/windows/SSGodot.windows.editor.x86_64.dll" -windows.debug.x86_64 = "res://bin/windows/SSGodot.windows.template_debug.x86_64.dll" -windows.release.x86_64 = "res://bin/windows/SSGodot.windows.template_release.x86_64.dll" +windows.editor.x86_64 = "windows/libSSGodot.windows.editor.x86_64.dll" +windows.debug.x86_64 = "windows/libSSGodot.windows.template_debug.x86_64.dll" +windows.release.x86_64 = "windows/libSSGodot.windows.template_release.x86_64.dll" -android.debug.x86_64 = "res://bin/android/libSSGodot.android.template_debug.x86_64.so" -android.release.x86_64 = "res://bin/android/libSSGodot.android.template_release.x86_64.so" +android.debug.x86_64 = "android/libSSGodot.android.template_debug.x86_64.so" +android.release.x86_64 = "android/libSSGodot.android.template_release.x86_64.so" -android.debug.arm32 = "res://bin/android/libSSGodot.android.template_debug.arm32.so" -android.release.arm32 = "res://bin/android/libSSGodot.android.template_release.arm32.so" +android.debug.arm32 = "android/libSSGodot.android.template_debug.arm32.so" +android.release.arm32 = "android/libSSGodot.android.template_release.arm32.so" -android.debug.arm64 = "res://bin/android/libSSGodot.android.template_debug.arm64.so" -android.release.arm64 = "res://bin/android/libSSGodot.android.template_release.arm64.so" +android.debug.arm64 = "android/libSSGodot.android.template_debug.arm64.so" +android.release.arm64 = "android/libSSGodot.android.template_release.arm64.so" -web.debug.threads.wasm32 = "res://bin/web/libSSGodot.web.template_debug.wasm32.wasm" -web.release.threads.wasm32 = "res://bin/web/libSSGodot.web.template_release.wasm32.wasm" +web.debug.threads.wasm32 = "web/libSSGodot.web.template_debug.wasm32.wasm" +web.release.threads.wasm32 = "web/libSSGodot.web.template_release.wasm32.wasm" + +web.debug.wasm32 = "web/libSSGodot.web.template_debug.wasm32.nothreads.wasm" +web.release.wasm32 = "web/libSSGodot.web.template_release.wasm32.nothreads.wasm" diff --git a/scripts/build-extension.sh b/scripts/build-extension.sh index 2b4c65e..ddea287 100755 --- a/scripts/build-extension.sh +++ b/scripts/build-extension.sh @@ -109,12 +109,7 @@ echo "scons command options: $scons_command_opts" pushd ${ROOTDIR} > /dev/null -if [[ "$opts[platform]" = "macos" ]] || [[ "$opts[platform]" = "ios" ]]; then - BINDIR=./bin/${opts[platform]}/${opts[platform]}.framework -else - BINDIR=./bin/${opts[platform]} -fi - +BINDIR=./bin/${opts[platform]} /bin/mkdir -p ${BINDIR} alias scons_macro="scons ${scons_command_opts}" if [[ ${opts[arch]} == "universal" ]]; then @@ -134,8 +129,9 @@ for arch in $ARCHES; do # strip ${BINDIR}/libSSGodot.macos.${opts[target]} # fi if [[ ${opts[platform]} == "ios" ]] && [[ ${opts[ios_simulator]} == "yes" ]]; then - echo mv - mv ${BINDIR}/libSSGodot.${opts[platform]}.${opts[target]} ${BINDIR}/libSSGodot.${opts[platform]}.${opts[target]}.simulator + pushd ${BINDIR} > /dev/null + mv libSSGodot.${opts[platform]}.${opts[target]}.framework libSSGodot.${opts[platform]}.${opts[target]}.simulator.framework + popd > /dev/null fi done diff --git a/scripts/release-gdextension-ios.sh b/scripts/release-gdextension-ios.sh index 6157139..82a110c 100755 --- a/scripts/release-gdextension-ios.sh +++ b/scripts/release-gdextension-ios.sh @@ -1,5 +1,6 @@ #!/usr/bin/env zsh set -e +set -x BASEDIR=$(dirname $0) BASEDIR=$(cd $BASEDIR && pwd -P) @@ -8,23 +9,26 @@ ROOTDIR=$(cd $ROOTDIR && pwd -P) pushd ${ROOTDIR} > /dev/null BINDIR=$(pwd)/bin/ios +/bin/rm -rf ${BINDIR} targets=("template_release" "template_debug") for target in ${targets[@]}; do - scripts/build-extension.sh platform=ios arch=universal strip=yes target=${target} ios_simulator=yes +# scripts/build-extension.sh platform=ios arch=universal strip=yes target=${target} ios_simulator=yes scripts/build-extension.sh platform=ios arch=universal strip=yes target=${target} ios_simulator=no done -# create xcframeworks pushd ${BINDIR} -for target in ${targets[@]}; do - rm -rf tmp - mkdir -p tmp/ios tmp/ios-simulator - mv $BINDIR/ios.framework/libSSGodot.ios.${target} tmp/ios/libSSGodot.ios.${target}.dylib - mv $BINDIR/ios.framework/libSSGodot.ios.${target}.simulator tmp/ios-simulator/libSSGodot.ios.${target}.dylib - xcodebuild -create-xcframework -library tmp/ios/libSSGodot.ios.${target}.dylib -library tmp/ios-simulator/libSSGodot.ios.${target}.dylib -output libSSGodot.ios.${target}.xcframework -done -rm -rf tmp -rm -rf ios.framework + +## create xcframeworks +#for target in ${targets[@]}; do +# rm -rf tmp +# mkdir -p tmp/ios tmp/ios-simulator +# mv $BINDIR/libSSGodot.ios.${target}.framework tmp/ios/libSSGodot.ios.${target}.framework +# mv $BINDIR/libSSGodot.ios.${target}.simulator.framework tmp/ios-simulator/libSSGodot.ios.${target}.framework +# xcodebuild -create-xcframework -framework tmp/ios/libSSGodot.ios.${target}.framework -framework tmp/ios-simulator/libSSGodot.ios.${target}.framework -output libSSGodot.ios.${target}.xcframework +#done +#/bin/rm -rf tmp + +/bin/rm -rf ios.framework popd > /dev/null # ${BINDIR} popd > /dev/null # ${ROOTDIR} diff --git a/scripts/release-gdextension-macos.sh b/scripts/release-gdextension-macos.sh index 4201df3..c2d3e4f 100755 --- a/scripts/release-gdextension-macos.sh +++ b/scripts/release-gdextension-macos.sh @@ -12,5 +12,6 @@ targets=("editor" "template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=macos arch=universal strip=yes target=${target} done +/bin/rmdir bin/macos/macos.framework popd > /dev/null # ${ROOTDIR} diff --git a/scripts/release-gdextension-web.sh b/scripts/release-gdextension-web.sh index 692f805..d8af102 100755 --- a/scripts/release-gdextension-web.sh +++ b/scripts/release-gdextension-web.sh @@ -11,7 +11,7 @@ pushd ${ROOTDIR} > /dev/null targets=("template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=web arch=wasm32 strip=yes target=${target} - # scripts/build-extension.sh platform=web arch=wasm32 strip=yes target=${target} threads=no + scripts/build-extension.sh platform=web arch=wasm32 strip=yes target=${target} threads=no done popd > /dev/null # ${ROOTDIR} From ba879ab8301189b97a9c619e55aecee8013499fc Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Thu, 14 Aug 2025 11:20:18 +0900 Subject: [PATCH 11/22] fix --- .github/workflows/extension.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index ac9daa5..b5acf02 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -121,10 +121,17 @@ jobs: echo "xcrun notarytool" - pushd bin/macos/ - zip ../../ssplayer_godot_extension_mac.zip ./* - popd - xcrun notarytool submit ssplayer_godot_extension_mac.zip --keychain-profile "notarytool-profile" --wait + NOTARIZATION_FILE=libSSGodot.macos.editor.zip + ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.editor.framework" "$NOTARIZATION_FILE" + xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait + + NOTARIZATION_FILE=libSSGodot.macos.template_debugn.zip + ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_debug.framework" "$NOTARIZATION_FILE" + xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait + + NOTARIZATION_FILE=libSSGodot.macos.template_release.zip + ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_release.framework" "$NOTARIZATION_FILE" + xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait echo "xcrun stapler" xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework" From eff86ff27998a028427f75de9f57ba9613e45692 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Thu, 14 Aug 2025 12:26:45 +0900 Subject: [PATCH 12/22] codesign frameworks instead of dylib files. --- .github/workflows/extension.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index b5acf02..5f134bc 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -112,9 +112,9 @@ jobs: run: | ./scripts/release-gdextension-macos.sh - for f in ./bin/macos/*.framework/lib* + for f in ./bin/macos/*.framework do - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp done xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTRIZATION_PWD" @@ -125,7 +125,7 @@ jobs: ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.editor.framework" "$NOTARIZATION_FILE" xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - NOTARIZATION_FILE=libSSGodot.macos.template_debugn.zip + NOTARIZATION_FILE=libSSGodot.macos.template_debug.zip ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_debug.framework" "$NOTARIZATION_FILE" xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait @@ -145,9 +145,9 @@ jobs: run: | ./scripts/release-gdextension-ios.sh - for f in ./bin/ios/*.framework/lib* + for f in ./bin/ios/*.framework do - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp done - name: build Android From 111916f0f34b2b0464edbf02b0df48d7325ebf8a Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Thu, 14 Aug 2025 13:23:29 +0900 Subject: [PATCH 13/22] fix --- scripts/release-gdextension-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release-gdextension-macos.sh b/scripts/release-gdextension-macos.sh index c2d3e4f..cd770db 100755 --- a/scripts/release-gdextension-macos.sh +++ b/scripts/release-gdextension-macos.sh @@ -12,6 +12,6 @@ targets=("editor" "template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=macos arch=universal strip=yes target=${target} done -/bin/rmdir bin/macos/macos.framework +/bin/rm -rf bin/macos/macos.framework popd > /dev/null # ${ROOTDIR} From 003e05b83be7f3edf4e933d4403e88c231cabf23 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Thu, 14 Aug 2025 18:03:29 +0900 Subject: [PATCH 14/22] restrcture a macos framework. --- scripts/build-extension.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/build-extension.sh b/scripts/build-extension.sh index ddea287..ae57780 100755 --- a/scripts/build-extension.sh +++ b/scripts/build-extension.sh @@ -135,6 +135,24 @@ for arch in $ARCHES; do fi done +# re-structure a macOS framework +# TODO: migrate to Sconstruct +if [[ ${opts[platform]} == "macos" ]]; then + pushd ${BINDIR}/libSSGodot.${opts[platform]}.${opts[target]}.framework/ > /dev/null + /bin/mkdir -p Versions/A + mv libSSGodot.${opts[platform]}.${opts[target]} Versions/A/ + mv Resources Versions/A/ + + pushd Versions > /dev/null + ln -shf A Current + popd > /dev/null + + ln -sf Versions/Current/libSSGodot.${opts[platform]}.${opts[target]} libSSGodot.${opts[platform]}.${opts[target]} + ln -sf Versions/Current/Resources Resources + popd > /dev/null +fi + + /bin/cp misc/ssplayer_godot_extension.gdextension ./examples/feature_test_gdextension/bin popd > /dev/null # ${ROOTDIR} From ef987203cbec0e97289b21bae0e0dde05255ca61 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Fri, 15 Aug 2025 16:54:36 +0900 Subject: [PATCH 15/22] clean before release build. --- scripts/release-gdextension-android.sh | 3 ++- scripts/release-gdextension-macos.sh | 3 ++- scripts/release-gdextension-web.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/release-gdextension-android.sh b/scripts/release-gdextension-android.sh index ec3d136..8f934fe 100755 --- a/scripts/release-gdextension-android.sh +++ b/scripts/release-gdextension-android.sh @@ -7,7 +7,8 @@ ROOTDIR=${BASEDIR}/.. ROOTDIR=$(cd $ROOTDIR && pwd -P) pushd ${ROOTDIR} > /dev/null - +BINDIR=$(pwd)/bin/android +/bin/rm -rf ${BINDIR} targets=("template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=android arch=arm32 strip=yes target=${target} diff --git a/scripts/release-gdextension-macos.sh b/scripts/release-gdextension-macos.sh index cd770db..456dac1 100755 --- a/scripts/release-gdextension-macos.sh +++ b/scripts/release-gdextension-macos.sh @@ -7,7 +7,8 @@ ROOTDIR=${BASEDIR}/.. ROOTDIR=$(cd $ROOTDIR && pwd -P) pushd ${ROOTDIR} > /dev/null - +BINDIR=$(pwd)/bin/macos +/bin/rm -rf ${BINDIR} targets=("editor" "template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=macos arch=universal strip=yes target=${target} diff --git a/scripts/release-gdextension-web.sh b/scripts/release-gdextension-web.sh index d8af102..ae5aacb 100755 --- a/scripts/release-gdextension-web.sh +++ b/scripts/release-gdextension-web.sh @@ -7,7 +7,8 @@ ROOTDIR=${BASEDIR}/.. ROOTDIR=$(cd $ROOTDIR && pwd -P) pushd ${ROOTDIR} > /dev/null - +BINDIR=$(pwd)/bin/web +/bin/rm -rf ${BINDIR} targets=("template_release" "template_debug") for target in ${targets[@]}; do scripts/build-extension.sh platform=web arch=wasm32 strip=yes target=${target} From 396cae9f38e502c8c42f343c568bef10a9a61d61 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 10:47:43 +0900 Subject: [PATCH 16/22] update documents --- BUILD.md | 53 +++++++++++++-- README.md | 186 +--------------------------------------------------- USAGE.md | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 240 insertions(+), 192 deletions(-) create mode 100644 USAGE.md diff --git a/BUILD.md b/BUILD.md index 71d0034..26610df 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,6 +1,6 @@ # ソース取得 -本リポジトリをクローンしてください。 +本リポジトリをクローンして、 `SSPlayerForGodot` ディレクトリ内に入ってください。 ```bash git clone --recursive https://github.com/SpriteStudio/SSPlayerForGodot.git @@ -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 @@ -50,10 +50,11 @@ popd ``` # ビルド環境のセットアップ -## Windows 以降でビルド環境の構築手順について説明していきます。 +## Windows + [Godot公式のコンパイル手順](https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_windows.html) 必要なツール @@ -104,7 +105,6 @@ brew install emscripten (Optional) target を Android のビルドをする際は Android NDK をインストールしてください。 - ## Linux T.B.D @@ -114,6 +114,9 @@ T.B.D [build.ps1](./scripts/build.ps1) でビルド可能です。 + +成果物は `godot\bin` に格納されます。 + **PowerShell** ```powershell @@ -131,6 +134,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build.ps1 ### 3.x [build-v3.ps1](./scripts/build-v3.ps1) でビルド可能です。 +成果物は `godot\bin` に格納されます。 **PowerShell** @@ -151,6 +155,7 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-v3.ps1 ### 4 [build.sh](./scripts/build.sh) でビルド可能です。 +成果物は `godot/bin` に格納されます。 ```sh ./scripts/build.sh @@ -182,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 @@ -214,6 +220,8 @@ PowerShell.exe -ExecutionPolicy Bypass -File .\scripts\build-v3.ps1 # GDExtension ## Windows [build-extension.ps1](./scripts/build-extension.ps1) でビルド可能です。 +成果物は `bin` ディレクトリに格納されます。 + **PowerShell** @@ -234,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 @@ -243,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 ``` diff --git a/README.md b/README.md index d6c88d9..a7ebb27 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ 実行時パフォーマンスを優先するため C++ モジュールの形態になっています。 SpriteStudioPlayer for Godot を利用する場合、SpriteStudioPlayer の[カスタムモジュール](https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_modules_in_cpp.html) を組み込んだ Godot Engine の Editor を手元でビルドするか、 SpriteStudioPlayer の [GDExtension](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/what_is_gdextension.html) をプロジェクトへ入れる必要があります。 - ## 対応する [OPTPiX SpriteStudio](https://www.webtech.co.jp/spritestudio/index.html) のバージョン Ver.6 と Ver.7 に対応しています。 @@ -23,190 +22,8 @@ Ver.6 と Ver.7 に対応しています。 [BUILD.md](BUILD.md) を参照してください。 # 使い方 -## SpriteStudioデータのインポート - -SpriteStudioデータのインポート手順について説明します。 -現在の SpriteStudio for Godot プラグインでは sspj ファイルを直接指定する形態になっています。 -ご利用のプロジェクト下のフォルダに sspj、ssae、ssce と画像ファイルなどの一式を配置します。 - -## SpriteStudioノードの作成と sspj ファイルの指定 - -1. 「Node を新規作成」から「GdNodeSsPlayer」を選択し、「作成」ボタンを押します。 -2. インスペクターの「Res Player」から「新規 GdResourceSsPlayer」を選択します。 -3. GdResourceSsPlayer の「Res Project」から「読み込み」を選択します。 -4. 「ファイルを開く」ダイアログから「*.sspj」ファイルを選択して開きます。 - -## アニメーションの指定 - -1. 「Animation Settings」を展開「Anime Pack」から再生させる「*.ssae」ファイルを選択します。 -2. 続いて「Animation」から再生させるアニメーションを選択します。 -3. Frame をドラッグしたり、Play フラグをオンにすることでプレビューできます。 - -### インスペクターの各プロパティの意味 - -![image](./doc_images/ssnode_inspector.png) - -``` -GdNodeSsPlayer - SsPlayer を扱うノード -├── Res Player - SsPlayer が使用するリソース -│ └── Res Project - sspj ファイル -│ └── CellMap Settings - セルマップの設定 -│ ├── ssce File 01 - セルマップ -│ └── ssce File 02 - セルマップ -│ -└── Animation Settings - アニメーションの設定 - ├── Anime Pack - アニメパック - ├── Animation - アニメーション - ├── Frame - 現在のフレーム - ├── Loop - ループ再生フラグ - ├── Playing - 再生フラグ - └── Texture Interpolate - テクスチャ補間フラグ -``` - -### テクスチャ補間フラグについて - -SSPlayer for Godot の実装(v1.2.0時点)では、一度アニメーションをテクスチャにレンダリングした後、Godot のレンダラーによってスクリーンバッファに描画されます。 -このテクスチャにレンダリングする際にバイリニア補間をかける場合はフラグをオンに設定します。 -この状態では回転して斜めになったパーツのエッジにアンチエイリアスがかかりますが、この動作が好ましくない場合はオフにしてください。 -このフラグをオフに設定し、CanvasItem の Texture の FilterMode も Nearest にしておくとスクリーンバッファに描画する際にも補間がかからずピクセルのエッジが明確になります。 -例えばピクセルアート系のゲームで利用する場合は、この設定を試してみて下さい。 - -#### レンダリングするテクスチャのサイズ -レンダリングするテクスチャのサイズはSpriteStudio上でアニメーションに設定した「基準枠」のサイズが採用されます。(v1.2.0時点) - -## クラス - -GDScript からコントロールできるクラスの役割と主要なメソッドについて説明します。 -各クラスが持っている全てのメソッド、プロパティ、シグナルについては Godot の Script 画面で確認してみてください。 - -### リソース管理クラス - -SpriteStudio の各種 .ss** ファイルに相当するリソースを管理するクラスがあります。 - -#### [GdResourceSsProject](./gd_spritestudio/gd_resource_ssproject.h) クラス - -1つの sspj ファイルに相当するリソースを取り扱うクラスです。 -sspj に登録された ssae, ssce, ssee 各々のリソースの取得と設定を行います。 - -#### [GdResourceSsCellMap](./gd_spritestudio/gd_resource_sscellmap.h) クラス - -1つの ssce ファイルに相当するリソースを取り扱うクラスです。 -現在テクスチャの取得と設定を行うメンバーのみ対応しています。 - -#### [GdResourceSsAnimePack](./gd_spritestudio/gd_resource_ssanimepack.h) クラス - -1つの ssae ファイルに相当するリソースを取り扱うクラスです。 -内包しているアニメーションの数、とアニメーション名の取得を行えます。 - -#### [GdResourceSsPlayer](./gd_spritestudio/gd_resource_ssplayer.h) クラス - -現在 GdResourceSsProject リソースを設定、取得するアクセサのみです。 - -### 再生のためのクラス - -GdNodeSsPlayer に前述のリソースを指定することで再生を行います。 -以下はファイルの読み込みから再生開始までのシンプルなサンプルコードです。 - -```python -# GdNodeSsPlayerノードを指します。 -## Godot 4 -@onread var ssnode = $target -## Godot 3.x -# onready var ssnode = $target -func _ready(): - # sspj ファイルを読み込みます。 - ssnode.res_player.res_project = ResourceLoader.load("Sample.sspj") - - # ssaeファイルとアニメーションを指定します。 - ssnode.set_anime_pack("Sample.ssae") - ssnode.set_animation("anime_1") - - # アニメーション終了時コールバックの設定 - ## Godot 4 - ssnode.connect("animation_finished", Callable(self, "_on_animation_finished")) - ## Godot 3.x - # ssnode.connect("animation_finished", self, "_on_animation_finished") - - # ループを指定して再生を開始します。 - ssnode.set_loop(true) - ssnode.play() - -# アニメ終了時のコールバック関数です -func _on_animation_finished(name): - print("SIGNAL _on_animation_finished from " + name) -``` - -他にもカレントフレームの指定、一時停止、開始、終了フレーム、FPSの取得など一般的なメソッドがあります。 -一覧は Godot の Script 画面で確認してみてください。 - -#### シグナル - -GdNodeSsPlayer が発行するシグナルについて説明します。 - -#### on_animation_changed(name: String) - -アニメーション変更時に発行されます。 -name:変更したアニメーション名 - -#### on_animation_finished(name: String) - -再生中のアニメーションが終了フレームに到達した時に発行されます。 -ループ再生オンでも毎周発行されます。 -name:変更したアニメーション名 - -#### on_animepack_changed(name: String) - -アニメパック変更時に発行されます。 -name:変更したアニメパック名 - -#### on_frame_changed(frame: int) - -フレーム位置変更時に発行されます。 -frame:変更したフレーム位置 - -#### on_signal(command: String, value: Dictionary) - -SpriteStudioのシグナルアトリビュートのキーフレーム到達時に発行されます。 -command:コマンド名 -value:パラメータ名と値のコレクション - -#### on_user_data(flag: int, intValue: int, rectValue: Rect2, pointValue: Vector2, stringValue: String) - -ユーザーデータのキーフレーム到達時に発行されます。 - -- flag:後続の引数が有効かどうかの論理値 - - 1:整数が有効 - - 2:範囲が有効 - - 4:位置が有効 - - 8:文字列が有効 -- intValue:整数 -- rectValue:範囲 -- pointValue:位置 -- stringValue:文字列 - -## 制限事項 - -### 動作しないもの - -- マスク機能 -- 描画モード:ミックス以外もミックス相当になります。 -- SpriteStudio Ver.7.1 で追加された新機能(テキスト・サウンド・9スライス・シェイプ) - -### 表示が異なるもの - -- パーツカラー - - [x] v1.1.1 で修正済:ミックスの頂点単位の時にX状(三角形の辺部分)の輝度が高くなっています。 - - [x] v1.1 で修正済:乗算でテクスチャカラーの割合がエディタより大きくなります。 - -### その他の制限 - -- インスタンスの独立動作がOnのパーツの再生について - - シーン上で Frame プロパティが 0 以外の状態で Play プロパティを On にして再生開始した場合、独立動作がOnに設定されたインスタンスパーツを再生させた場合、インスタンスパーツの再生フレームがずれることがあります。 - - この場合、一旦 Frame プロパティの値を 0 以外に変更後、0 に戻してから再生開始することで一致させられます。 -- シェーダー - - SpriteStudio公式の一部のみ対応しています。 - - カスタムシェーダーは独自に追加・対応する必要があります。 +[USAGE.md](USAGE.md) を参照してください。 # サンプル @@ -248,7 +65,6 @@ gdextension の動作確認用プロジェクトです。 確認できるサンプルは [feature_test](./examples/feature_test) と同じものになります。 - # お問い合わせ ご質問、ご要望、不具合のご報告は [Issues](../../issues) に投稿してください。 diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..86bb77c --- /dev/null +++ b/USAGE.md @@ -0,0 +1,193 @@ +# エディタの選択 +下記どちらかの方法で利用してください。 + +- SpriteStudioPlayer のカスタムモジュールを組み込んだ Godot Engine を用意する。 + - [BUILD.md](BUILD.md) を参照してください +- SpriteStudioPlayer の GDExtension を Godot プロジェクトの `bin` ディレクトリへ格納する。 + - [リリース](https://github.com/SpriteStudio/SSPlayerForGodot/releases)を参照してください。自前でビルドする場合は [BUILD.md](BUILD.md) を参照してください + + +# SpriteStudioデータのインポート + +SpriteStudioデータのインポート手順について説明します。 +現在の SpriteStudio for Godot プラグインでは sspj ファイルを直接指定する形態になっています。 +ご利用のプロジェクト下のフォルダに sspj、ssae、ssce と画像ファイルなどの一式を配置します。 + +# SpriteStudioノードの作成と sspj ファイルの指定 + +1. 「Node を新規作成」から「GdNodeSsPlayer」を選択し、「作成」ボタンを押します。 +2. インスペクターの「Res Player」から「新規 GdResourceSsPlayer」を選択します。 +3. GdResourceSsPlayer の「Res Project」から「読み込み」を選択します。 +4. 「ファイルを開く」ダイアログから「*.sspj」ファイルを選択して開きます。 + +# アニメーションの指定 + +1. 「Animation Settings」を展開「Anime Pack」から再生させる「*.ssae」ファイルを選択します。 +2. 続いて「Animation」から再生させるアニメーションを選択します。 +3. Frame をドラッグしたり、Play フラグをオンにすることでプレビューできます。 + +## インスペクターの各プロパティの意味 + +![image](./doc_images/ssnode_inspector.png) + +``` +GdNodeSsPlayer - SsPlayer を扱うノード +├── Res Player - SsPlayer が使用するリソース +│ └── Res Project - sspj ファイル +│ └── CellMap Settings - セルマップの設定 +│ ├── ssce File 01 - セルマップ +│ └── ssce File 02 - セルマップ +│ +└── Animation Settings - アニメーションの設定 + ├── Anime Pack - アニメパック + ├── Animation - アニメーション + ├── Frame - 現在のフレーム + ├── Loop - ループ再生フラグ + ├── Playing - 再生フラグ + └── Texture Interpolate - テクスチャ補間フラグ +``` + +## テクスチャ補間フラグについて + +SSPlayer for Godot の実装(v1.2.0時点)では、一度アニメーションをテクスチャにレンダリングした後、Godot のレンダラーによってスクリーンバッファに描画されます。 +このテクスチャにレンダリングする際にバイリニア補間をかける場合はフラグをオンに設定します。 +この状態では回転して斜めになったパーツのエッジにアンチエイリアスがかかりますが、この動作が好ましくない場合はオフにしてください。 +このフラグをオフに設定し、CanvasItem の Texture の FilterMode も Nearest にしておくとスクリーンバッファに描画する際にも補間がかからずピクセルのエッジが明確になります。 +例えばピクセルアート系のゲームで利用する場合は、この設定を試してみて下さい。 + +### レンダリングするテクスチャのサイズ +レンダリングするテクスチャのサイズはSpriteStudio上でアニメーションに設定した「基準枠」のサイズが採用されます。(v1.2.0時点) + +# クラス + +GDScript からコントロールできるクラスの役割と主要なメソッドについて説明します。 +各クラスが持っている全てのメソッド、プロパティ、シグナルについては Godot の Script 画面で確認してみてください。 + +## リソース管理クラス + +SpriteStudio の各種 .ss** ファイルに相当するリソースを管理するクラスがあります。 + +### [GdResourceSsProject](./gd_spritestudio/gd_resource_ssproject.h) クラス + +1つの sspj ファイルに相当するリソースを取り扱うクラスです。 +sspj に登録された ssae, ssce, ssee 各々のリソースの取得と設定を行います。 + +### [GdResourceSsCellMap](./gd_spritestudio/gd_resource_sscellmap.h) クラス + +1つの ssce ファイルに相当するリソースを取り扱うクラスです。 +現在テクスチャの取得と設定を行うメンバーのみ対応しています。 + +### [GdResourceSsAnimePack](./gd_spritestudio/gd_resource_ssanimepack.h) クラス + +1つの ssae ファイルに相当するリソースを取り扱うクラスです。 +内包しているアニメーションの数、とアニメーション名の取得を行えます。 + +### [GdResourceSsPlayer](./gd_spritestudio/gd_resource_ssplayer.h) クラス + +現在 GdResourceSsProject リソースを設定、取得するアクセサのみです。 + +## 再生のためのクラス + +GdNodeSsPlayer に前述のリソースを指定することで再生を行います。 +以下はファイルの読み込みから再生開始までのシンプルなサンプルコードです。 + +```python +# GdNodeSsPlayerノードを指します。 +## Godot 4 +@onread var ssnode = $target +## Godot 3.x +# onready var ssnode = $target + +func _ready(): + # sspj ファイルを読み込みます。 + ssnode.res_player.res_project = ResourceLoader.load("Sample.sspj") + + # ssaeファイルとアニメーションを指定します。 + ssnode.set_anime_pack("Sample.ssae") + ssnode.set_animation("anime_1") + + # アニメーション終了時コールバックの設定 + ## Godot 4 + ssnode.connect("animation_finished", Callable(self, "_on_animation_finished")) + ## Godot 3.x + # ssnode.connect("animation_finished", self, "_on_animation_finished") + + # ループを指定して再生を開始します。 + ssnode.set_loop(true) + ssnode.play() + +# アニメ終了時のコールバック関数です +func _on_animation_finished(name): + print("SIGNAL _on_animation_finished from " + name) +``` + +他にもカレントフレームの指定、一時停止、開始、終了フレーム、FPSの取得など一般的なメソッドがあります。 +一覧は Godot の Script 画面で確認してみてください。 + +### シグナル + +GdNodeSsPlayer が発行するシグナルについて説明します。 + +### on_animation_changed(name: String) + +アニメーション変更時に発行されます。 +name:変更したアニメーション名 + +### on_animation_finished(name: String) + +再生中のアニメーションが終了フレームに到達した時に発行されます。 +ループ再生オンでも毎周発行されます。 +name:変更したアニメーション名 + +### on_animepack_changed(name: String) + +アニメパック変更時に発行されます。 +name:変更したアニメパック名 + +### on_frame_changed(frame: int) + +フレーム位置変更時に発行されます。 +frame:変更したフレーム位置 + +### on_signal(command: String, value: Dictionary) + +SpriteStudioのシグナルアトリビュートのキーフレーム到達時に発行されます。 +command:コマンド名 +value:パラメータ名と値のコレクション + +### on_user_data(flag: int, intValue: int, rectValue: Rect2, pointValue: Vector2, stringValue: String) + +ユーザーデータのキーフレーム到達時に発行されます。 + +- flag:後続の引数が有効かどうかの論理値 + - 1:整数が有効 + - 2:範囲が有効 + - 4:位置が有効 + - 8:文字列が有効 +- intValue:整数 +- rectValue:範囲 +- pointValue:位置 +- stringValue:文字列 + +# 制限事項 + +## 動作しないもの + +- マスク機能 +- 描画モード:ミックス以外もミックス相当になります。 +- SpriteStudio Ver.7.1 で追加された新機能(テキスト・サウンド・9スライス・シェイプ) + +## 表示が異なるもの + +- パーツカラー + - [x] v1.1.1 で修正済:ミックスの頂点単位の時にX状(三角形の辺部分)の輝度が高くなっています。 + - [x] v1.1 で修正済:乗算でテクスチャカラーの割合がエディタより大きくなります。 + +## その他の制限 + +- インスタンスの独立動作がOnのパーツの再生について + - シーン上で Frame プロパティが 0 以外の状態で Play プロパティを On にして再生開始した場合、独立動作がOnに設定されたインスタンスパーツを再生させた場合、インスタンスパーツの再生フレームがずれることがあります。 + - この場合、一旦 Frame プロパティの値を 0 以外に変更後、0 に戻してから再生開始することで一致させられます。 +- シェーダー + - SpriteStudio公式の一部のみ対応しています。 + - カスタムシェーダーは独自に追加・対応する必要があります。 From 152fd5c6f4c7ab97d3f59310dbce8bab2a3ec27f Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 13:00:38 +0900 Subject: [PATCH 17/22] update --- .github/workflows/extension.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 5f134bc..b016965 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -36,7 +36,7 @@ jobs: platform: windows - name: 🍎 macOS (universal) - os: macos-15 + os: macos-latest platform: macos - name: 🤖 Android (arm64) @@ -44,7 +44,7 @@ jobs: platform: android - name: 🍏 iOS (arm64) - os: macos-15 + os: macos-latest platform: ios - name: 🌐 Web (wasm32) @@ -114,7 +114,7 @@ jobs: for f in ./bin/macos/*.framework do - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" --deep --options runtime --timestamp $f/ done xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTRIZATION_PWD" @@ -147,7 +147,9 @@ jobs: for f in ./bin/ios/*.framework do - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp + lib=$(basename $f .framework) + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/$lib --deep --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/Versions/A --deep --options runtime --timestamp done - name: build Android From 020b2f917ef9b1d90af175669b3ebb34baaeacab Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 13:07:01 +0900 Subject: [PATCH 18/22] rename bundle id --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 6921c39..a5e2b1e 100644 --- a/SConstruct +++ b/SConstruct @@ -115,7 +115,7 @@ if env["platform"] == "macos" or env["platform"] == "ios": plist_subst = { "${BUNDLE_LIBRARY}": file, "${BUNDLE_NAME}": "ssplayer-godot", - "${BUNDLE_IDENTIFIER}": "jp.co.cri-mw.spritestudio.ssplayer-godot", + "${BUNDLE_IDENTIFIER}": "jp.co.cri-mw.spritestudio.ssplayer-godot.{}".format(env["target"]), "${BUNDLE_VERSION}": subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('utf-8').strip().split('-')[0] + '.0', "${MIN_MACOS_VERSION}": "10.12", "${MIN_IOS_VERSION}": "12.0" From 2bcde72e5b4813c71d6822b8dcfba33c02bcb0fc Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 13:07:37 +0900 Subject: [PATCH 19/22] fix --- .github/workflows/extension.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index b016965..d9fb6a3 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -114,7 +114,9 @@ jobs: for f in ./bin/macos/*.framework do - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" --deep --options runtime --timestamp $f/ + lib=$(basename $f .framework) + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/$lib --deep --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/Versions/A --deep --options runtime --timestamp done xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTRIZATION_PWD" @@ -147,9 +149,7 @@ jobs: for f in ./bin/ios/*.framework do - lib=$(basename $f .framework) - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/$lib --deep --options runtime --timestamp - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/Versions/A --deep --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp done - name: build Android From 0f86bc91cd8669117dfa03f907de8423f7c444c8 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 13:41:40 +0900 Subject: [PATCH 20/22] comment out stapler --- .github/workflows/extension.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index d9fb6a3..f846397 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -135,10 +135,10 @@ jobs: ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_release.framework" "$NOTARIZATION_FILE" xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - echo "xcrun stapler" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework" + #echo "xcrun stapler" + #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework" + #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework" + #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework" - name: build iOS if: matrix.platform == 'ios' From 37d245cc7488d084e3f2cfbeaf2e450a4b17c43c Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 17 Aug 2025 14:38:24 +0900 Subject: [PATCH 21/22] update --- .github/workflows/extension.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index f846397..06ad310 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -114,8 +114,7 @@ jobs: for f in ./bin/macos/*.framework do - lib=$(basename $f .framework) - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/$lib --deep --options runtime --timestamp + codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f --deep --options runtime --timestamp codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/Versions/A --deep --options runtime --timestamp done @@ -135,10 +134,10 @@ jobs: ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_release.framework" "$NOTARIZATION_FILE" xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - #echo "xcrun stapler" - #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework" - #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework" - #xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework" + echo "xcrun stapler" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework/Versions/A" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework/Versions/A" + xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework/Versions/A" - name: build iOS if: matrix.platform == 'ios' From 09469f9920c6f81450ea4ca94719c08016596df4 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Mon, 18 Aug 2025 18:29:48 +0900 Subject: [PATCH 22/22] disable Notarizing. --- .github/workflows/extension.yml | 25 ------------------------- scripts/build-extension.sh | 18 ------------------ 2 files changed, 43 deletions(-) diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 06ad310..326269f 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -106,39 +106,14 @@ jobs: if: matrix.platform == 'macos' env: DEV_ID_APPLICATION: ${{ secrets.DEV_ID_APPLICATION }} - APPLE_ID: ${{ secrets.APPLE_ID }} - TEAM_ID: ${{ secrets.TEAM_ID }} - NOTRIZATION_PWD: ${{ secrets.NOTARIZATION_PWD }} 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 - codesign --force --verify --verbose --keychain ${{ env.KEYCHAIN_PATH }} --sign "${DEV_ID_APPLICATION}" $f/Versions/A --deep --options runtime --timestamp done - xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_ID" --team-id "$TEAM_ID" --password "$NOTRIZATION_PWD" - - echo "xcrun notarytool" - - NOTARIZATION_FILE=libSSGodot.macos.editor.zip - ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.editor.framework" "$NOTARIZATION_FILE" - xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - - NOTARIZATION_FILE=libSSGodot.macos.template_debug.zip - ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_debug.framework" "$NOTARIZATION_FILE" - xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - - NOTARIZATION_FILE=libSSGodot.macos.template_release.zip - ditto -c -k --sequesterRsrc --keepParent "./bin/macos/libSSGodot.macos.template_release.framework" "$NOTARIZATION_FILE" - xcrun notarytool submit "$NOTARIZATION_FILE" --keychain-profile "notarytool-profile" --wait - - echo "xcrun stapler" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.editor.framework/Versions/A" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_debug.framework/Versions/A" - xcrun stapler staple -v "./bin/macos/libSSGodot.macos.template_release.framework/Versions/A" - - name: build iOS if: matrix.platform == 'ios' env: diff --git a/scripts/build-extension.sh b/scripts/build-extension.sh index ae57780..ddea287 100755 --- a/scripts/build-extension.sh +++ b/scripts/build-extension.sh @@ -135,24 +135,6 @@ for arch in $ARCHES; do fi done -# re-structure a macOS framework -# TODO: migrate to Sconstruct -if [[ ${opts[platform]} == "macos" ]]; then - pushd ${BINDIR}/libSSGodot.${opts[platform]}.${opts[target]}.framework/ > /dev/null - /bin/mkdir -p Versions/A - mv libSSGodot.${opts[platform]}.${opts[target]} Versions/A/ - mv Resources Versions/A/ - - pushd Versions > /dev/null - ln -shf A Current - popd > /dev/null - - ln -sf Versions/Current/libSSGodot.${opts[platform]}.${opts[target]} libSSGodot.${opts[platform]}.${opts[target]} - ln -sf Versions/Current/Resources Resources - popd > /dev/null -fi - - /bin/cp misc/ssplayer_godot_extension.gdextension ./examples/feature_test_gdextension/bin popd > /dev/null # ${ROOTDIR}