This repository has been archived by the owner on Jan 29, 2025. It is now read-only.
rework workflow file and update export presets. testing extension lin… #130
Workflow file for this run
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 Launcher | |
on: | |
pull_request: | |
branches: | |
- "master" | |
push: | |
branches: | |
- "wallet-starters" | |
workflow_dispatch: | |
jobs: | |
build-extension: | |
name: Build GDExtension | |
runs-on: ${{ matrix.build == 'windows' && 'windows' || matrix.build == 'macos' && 'macos' || 'ubuntu' }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [macos, windows, linux] | |
outputs: | |
extension_path: ${{ steps.save-path.outputs.path }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.build == 'windows' && 'x86_64-pc-windows-msvc' || matrix.build == 'linux' && 'x86_64-unknown-linux-gnu' || 'aarch64-apple-darwin' }} | |
- name: Install Windows build tools | |
if: matrix.build == 'windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Build GDExtension library (Windows) | |
if: matrix.build == 'windows' | |
shell: cmd | |
run: | | |
set PATH=%PATH:C:\Program Files\Git\usr\bin;=% | |
set PATH=%PATH:C:\Program Files\Git\bin;=% | |
cd cusf_launcher_crypto | |
mkdir ..\cusf_launcher\addons\cusf_launcher_crypto\bin | |
cargo build --release --target x86_64-pc-windows-msvc | |
copy target\x86_64-pc-windows-msvc\release\cusf_launcher_crypto.dll ..\cusf_launcher\addons\cusf_launcher_crypto\bin\ | |
- name: Build GDExtension library (Unix) | |
if: matrix.build != 'windows' | |
shell: bash | |
run: | | |
cd cusf_launcher_crypto | |
mkdir -p ../cusf_launcher/addons/cusf_launcher_crypto/bin | |
if [ "${{ matrix.build }}" = "linux" ]; then | |
cargo build --release --target x86_64-unknown-linux-gnu | |
cp target/x86_64-unknown-linux-gnu/release/libcusf_launcher_crypto.so ../cusf_launcher/addons/cusf_launcher_crypto/bin/ | |
else | |
cargo build --release --target aarch64-apple-darwin | |
cp target/aarch64-apple-darwin/release/libcusf_launcher_crypto.dylib ../cusf_launcher/addons/cusf_launcher_crypto/bin/ | |
fi | |
- name: Cache GDExtension | |
uses: actions/cache@v3 | |
with: | |
path: cusf_launcher/addons/cusf_launcher_crypto/bin | |
key: gdextension-${{ matrix.build }}-${{ github.sha }} | |
build-godot: | |
name: Build Godot Project | |
needs: build-extension | |
runs-on: ${{ matrix.build == 'macos' && 'macos' || 'ubuntu' }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [macos, windows, linux] | |
include: | |
- build: linux | |
target-bin: 'cusf_launcher.x86_64' | |
- build: macos | |
target-bin: 'cusf_launcher.dmg' | |
- build: windows | |
target-bin: 'cusf_launcher.exe' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: chickensoft-games/setup-godot@v1 | |
with: | |
version: 4.3.0 | |
use-dotnet: false | |
include-templates: true | |
- name: Restore GDExtension | |
uses: actions/cache@v3 | |
with: | |
path: cusf_launcher/addons/cusf_launcher_crypto/bin | |
key: gdextension-${{ matrix.build }}-${{ github.sha }} | |
- name: Verify Setup | |
run: godot --version | |
- name: Import certificate to Keychain | |
if: ${{ matrix.build == 'macos' }} | |
run: | | |
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12 | |
KEYCHAIN_PASSWORD=$(uuidgen) | |
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
security import ./certificate.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain | |
env: | |
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
- name: Setup notarization credentials | |
if: ${{ matrix.build == 'macos' }} | |
working-directory: cusf_launcher | |
run: | | |
echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8 | |
# MUST be run before build | |
- name: Initialize godot cache | |
run: python3 .github/scripts/godot_ci_cache.py | |
- name: Export build | |
run: | | |
name="${{fromJSON('{"windows": "Windows", "macos": "Mac", "linux": "Linux"}')[matrix.build] }}" | |
if [ "${{ matrix.build }}" = "macos" ]; then | |
# Force release any resources that might be in use | |
killall Finder || true | |
killall Dock || true | |
sleep 5 | |
fi | |
godot --path "./cusf_launcher/" --headless --export-release "$name" "${{ matrix.target-bin }}" --verbose 2>&1 | tee build.log | |
env: | |
GODOT_MACOS_NOTARIZATION_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} | |
GODOT_MACOS_NOTARIZATION_API_KEY: ./notarization_api_key.p8 | |
GODOT_MACOS_NOTARIZATION_API_UUID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} | |
- name: Create DMG (macOS) | |
if: ${{ matrix.build == 'macos' }} | |
run: | | |
# Show what files we have | |
echo "Contents of cusf_launcher directory:" | |
ls -la cusf_launcher/ | |
# Only create DMG if Godot didn't create one | |
if [ ! -f "cusf_launcher/cusf_launcher.dmg" ] && [ -d "cusf_launcher/cusf_launcher.app" ]; then | |
echo "Godot DMG not found but .app exists, creating DMG manually..." | |
cd cusf_launcher | |
hdiutil create -fs HFS+ -volname "CUSF Launcher" -srcfolder cusf_launcher.app cusf_launcher.dmg | |
else | |
echo "Using Godot-created DMG or no .app bundle found" | |
fi | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cusf_launcher_${{ matrix.build }} | |
if-no-files-found: error | |
path: | | |
cusf_launcher/${{ matrix.target-bin }} | |
cusf_launcher/*.app | |
cusf_launcher/*.dmg | |
- name: Wait for notarization to finish | |
if: ${{ matrix.build == 'macos' }} | |
run: | | |
request_id=$(grep 'Notarization request UUID' build.log | rev | cut -d ' ' -f 1 | rev | tr -d '"') | |
xcrun notarytool wait $request_id \ | |
--issuer ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} \ | |
--key-id ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} \ | |
--key ./cusf_launcher/notarization_api_key.p8 |