|
| 1 | +on: |
| 2 | + workflow_call: |
| 3 | + inputs: |
| 4 | + steamworks_sdk_tag: |
| 5 | + required: true |
| 6 | + type: string |
| 7 | + godot_tag: |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + build_params: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + artifact_name: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + export_name: |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + secrets: |
| 20 | + steamworks_sdk_repo: |
| 21 | + required: true |
| 22 | + steamworks_sdk_repo_token: |
| 23 | + required: true |
| 24 | + |
| 25 | + |
| 26 | +jobs: |
| 27 | + build-macos: |
| 28 | + runs-on: macos-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + # Checkout Godot |
| 32 | + - name: Checkout Godot |
| 33 | + uses: actions/checkout@v3 |
| 34 | + with: |
| 35 | + repository: "godotengine/godot" |
| 36 | + path: "godot" |
| 37 | + ref: ${{ inputs.godot_tag }} |
| 38 | + # Checkout current source of GodotSteam |
| 39 | + - name: Checkout GodotSteam |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + path: "godotsteam" |
| 43 | + - name: Copy GodotSteam Module |
| 44 | + run: | |
| 45 | + cp -r godotsteam godot/modules/godotsteam |
| 46 | + # Checkout Steamworks SDK |
| 47 | + - name: Checkout Steamworks SDK |
| 48 | + uses: actions/checkout@v3 |
| 49 | + with: |
| 50 | + path: "steamworks" |
| 51 | + repository: ${{ secrets.steamworks_sdk_repo }} |
| 52 | + token: ${{ secrets.steamworks_sdk_repo_token }} |
| 53 | + ref: ${{ inputs.steamworks_sdk_tag }} |
| 54 | + - name: Copy Steamworks |
| 55 | + run: | |
| 56 | + cp -r steamworks/public godot/modules/godotsteam/sdk |
| 57 | + cp -r steamworks/redistributable_bin godot/modules/godotsteam/sdk |
| 58 | + ls -la godot/modules/godotsteam/sdk |
| 59 | + # Install the Vulkan SDK, script copied from the official Godot build scripts. |
| 60 | + - name: Install Vulkan SDK |
| 61 | + run: | |
| 62 | + set -euo pipefail |
| 63 | + IFS=$'\n\t' |
| 64 | + # Download and install the Vulkan SDK. |
| 65 | + curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg" -o /tmp/vulkan-sdk.dmg |
| 66 | + hdiutil attach /tmp/vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk |
| 67 | + /Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan \ |
| 68 | + --accept-licenses --default-answer --confirm-command install |
| 69 | + cnt=5 |
| 70 | + until hdiutil detach -force /Volumes/vulkan-sdk |
| 71 | + do |
| 72 | + [[ cnt -eq "0" ]] && break |
| 73 | + sleep 1 |
| 74 | + ((cnt--)) |
| 75 | + done |
| 76 | + rm -f /tmp/vulkan-sdk.dmg |
| 77 | + echo 'Vulkan SDK installed successfully!' |
| 78 | + - name: Install Build Tools |
| 79 | + run: | |
| 80 | + brew install scons yasm |
| 81 | + - name: Build MacOS |
| 82 | + working-directory: "godot" |
| 83 | + run: | |
| 84 | + scons ${{ inputs.build_params }} |
| 85 | + - name: Upload MacOS Build |
| 86 | + uses: actions/upload-artifact@v3 |
| 87 | + with: |
| 88 | + name: ${{ inputs.artifact_name }} |
| 89 | + path: godot/bin/${{ inputs.export_name }} |
| 90 | + if-no-files-found: error |
| 91 | + retention-days: 1 |
| 92 | + - name: Upload MacOS Steam Dylib |
| 93 | + uses: actions/upload-artifact@v3 |
| 94 | + with: |
| 95 | + name: macos-libsteam-api-dylib |
| 96 | + path: godot/modules/godotsteam/sdk/redistributable_bin/osx/libsteam_api.dylib |
| 97 | + if-no-files-found: error |
| 98 | + retention-days: 1 |
| 99 | + - name: Zip the MacOS Apps |
| 100 | + run: | |
| 101 | + pushd godot/misc/dist |
| 102 | + zip -r ./macos_tools.zip ./macos_tools.app/ |
| 103 | + zip -r ./macos_template.zip ./macos_template.app/ |
| 104 | + popd |
| 105 | + - name: Upload MacOS Tool App |
| 106 | + uses: actions/upload-artifact@v3 |
| 107 | + with: |
| 108 | + name: macos-tool-app |
| 109 | + path: godot/misc/dist/macos_tools.zip |
| 110 | + if-no-files-found: error |
| 111 | + retention-days: 1 |
| 112 | + - name: Upload MacOS Template App |
| 113 | + uses: actions/upload-artifact@v3 |
| 114 | + with: |
| 115 | + name: macos-template-app |
| 116 | + path: godot/misc/dist/macos_template.zip |
| 117 | + if-no-files-found: error |
| 118 | + retention-days: 1 |
0 commit comments