|
1 |
| -# name: Build GDExtension |
2 |
| -# on: |
3 |
| -# workflow_call: |
4 |
| -# push: |
5 |
| -# pull_request: |
6 |
| -# merge_group: |
| 1 | +name: Build GDExtension |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + merge_group: |
7 | 7 |
|
8 |
| -# jobs: |
9 |
| -# build: |
10 |
| -# strategy: |
11 |
| -# fail-fast: false |
12 |
| -# matrix: |
13 |
| -# # A build is made for every possible combination of parameters |
14 |
| -# # You can add or remove entries from the arrays of each parameter to custimize which builds you want to run |
15 |
| -# # See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow |
16 |
| -# target: |
17 |
| -# [ |
18 |
| -# { platform: linux, arch: x86_64, os: ubuntu-22.04 }, |
19 |
| -# { platform: windows, arch: x86_64, os: windows-latest }, |
20 |
| -# { platform: windows, arch: x86_32, os: windows-latest }, |
21 |
| -# { platform: macos, arch: universal, os: macos-latest }, |
22 |
| -# { platform: android, arch: arm64, os: ubuntu-22.04 }, |
23 |
| -# { platform: android, arch: arm32, os: ubuntu-22.04 }, |
24 |
| -# { platform: android, arch: x86_64, os: ubuntu-22.04 }, |
25 |
| -# { platform: android, arch: x86_32, os: ubuntu-22.04 }, |
26 |
| -# { platform: ios, arch: arm64, os: macos-latest }, |
27 |
| -# { platform: web, arch: wasm32, os: ubuntu-22.04 } |
28 |
| -# ] |
29 |
| -# target-type: [template_debug] |
30 |
| -# float-precision: [single, double] |
31 |
| -# include: # Also build a release version for these specific targets. Remove if you add template_release above. |
32 |
| -# - target: { platform: linux, arch: x86_64, os: ubuntu-22.04 } |
33 |
| -# target-type: template_release |
34 |
| -# float-precision: single |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + # A build is made for every possible combination of parameters |
| 14 | + # You can add or remove entries from the arrays of each parameter to customize which builds you want to run |
| 15 | + # See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow |
| 16 | + target: [ |
| 17 | + { platform: linux, arch: x86_64, os: ubuntu-22.04 }, |
| 18 | + { platform: linux, arch: aarch64, os: ubuntu-22.04 }, |
| 19 | + { platform: windows, arch: x86_64, os: windows-latest }, |
| 20 | + { platform: windows, arch: x86_32, os: windows-latest }, |
| 21 | + { platform: macos, arch: universal, os: macos-latest }, |
| 22 | + # { platform: android, arch: arm64, os: ubuntu-22.04 }, |
| 23 | + # { platform: android, arch: arm32, os: ubuntu-22.04 }, |
| 24 | + # { platform: android, arch: x86_64, os: ubuntu-22.04 }, |
| 25 | + # { platform: android, arch: x86_32, os: ubuntu-22.04 }, |
| 26 | + # { platform: ios, arch: arm64, os: macos-latest }, |
| 27 | + # { platform: web, arch: wasm32, os: ubuntu-22.04 }, |
| 28 | + ] |
| 29 | + target-type: [template_release, template_debug] |
| 30 | + float-precision: [single, double] |
| 31 | + # include: # Also build a release version for these specific targets. Remove if you add template_release above. |
| 32 | + # - target: { platform: linux, arch: x86_64, os: ubuntu-22.04 } |
| 33 | + # target-type: template_release |
| 34 | + # float-precision: single |
35 | 35 |
|
36 |
| -# - target: { platform: linux, arch: x86_64, os: ubuntu-22.04 } |
37 |
| -# target-type: template_release |
38 |
| -# float-precision: double |
| 36 | + # - target: { platform: linux, arch: x86_64, os: ubuntu-22.04 } |
| 37 | + # target-type: template_release |
| 38 | + # float-precision: double |
39 | 39 |
|
40 |
| -# runs-on: ${{ matrix.target.os }} |
41 |
| -# steps: |
42 |
| -# # Clone this repository |
43 |
| -# - name: Checkout |
44 |
| -# uses: actions/checkout@v4 |
45 |
| -# with: |
46 |
| -# submodules: true |
| 40 | + runs-on: ${{ matrix.target.os }} |
| 41 | + steps: |
| 42 | + # Clone this repository |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + submodules: true |
47 | 47 |
|
48 |
| -# # Lint |
49 |
| -# #- name: Setup clang-format |
50 |
| -# # shell: bash |
51 |
| -# # run: | |
52 |
| -# # python -m pip install clang-format |
53 |
| -# #- name: Run clang-format |
54 |
| -# # shell: bash |
55 |
| -# # run: | |
56 |
| -# # clang-format src/** --dry-run --Werror |
| 48 | + # Lint |
| 49 | + #- name: Setup clang-format |
| 50 | + # shell: bash |
| 51 | + # run: | |
| 52 | + # python -m pip install clang-format |
| 53 | + #- name: Run clang-format |
| 54 | + # shell: bash |
| 55 | + # run: | |
| 56 | + # clang-format src/** --dry-run --Werror |
57 | 57 |
|
58 |
| -# # Setup dependencies |
59 |
| -# - name: Setup godot-cpp |
60 |
| -# uses: ./godot-cpp/.github/actions/setup-godot-cpp |
61 |
| -# with: |
62 |
| -# platform: ${{ matrix.target.platform }} |
63 |
| -# em-version: 3.1.62 |
| 58 | + # Get the Kuzu Binaries |
| 59 | + - name: Download Kuzu Binaries |
| 60 | + run: | |
| 61 | + case ${{ matrix.target.platform }} in |
| 62 | + linux) |
| 63 | + KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-linux-${{ matrix.target.arch }}.tar.gz" |
| 64 | + ;; |
| 65 | + windows) |
| 66 | + KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-windows-x86_64.zip" |
| 67 | + ;; |
| 68 | + macos) |
| 69 | + KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-osx-universal.tar.gz" |
| 70 | + ;; |
| 71 | + android) |
| 72 | + KUZU_URL="https://github.com/kuzudb/kuzu/releases/download/v0.10.0/libkuzu-android-armv8a.tar.gz" |
| 73 | + ;; |
| 74 | + *) |
| 75 | + echo "Unsupported platform: ${{ matrix.target.platform }}" |
| 76 | + exit 1 |
| 77 | + ;; |
| 78 | + esac |
64 | 79 |
|
65 |
| -# # Build GDExtension (with caches) |
| 80 | + curl -L -o kuzu_binary.tar.gz "$KUZU_URL" |
66 | 81 |
|
67 |
| -# - name: Restore .scons_cache |
68 |
| -# uses: ./godot-cpp/.github/actions/godot-cache-restore |
69 |
| -# with: |
70 |
| -# scons-cache: ${{ github.workspace }}/.scons-cache/ |
71 |
| -# cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
| 82 | + - name: Extract Kuzu Binaries |
| 83 | + run: | |
| 84 | + if [[ "${{ matrix.target.platform }}" == "windows" ]]; then |
| 85 | + unzip kuzu_binary.tar.gz -d ${{ github.workspace }}/bin/${{ matrix.target.platform }}/kuzu/ |
| 86 | + else |
| 87 | + tar -xvzf kuzu_binary.tar.gz -C ${{ github.workspace }}/bin/${{ matrix.target.platform }}/kuzu/ |
| 88 | + fi |
| 89 | + - name: Verify Kuzu Binaries |
| 90 | + run: | |
| 91 | + ls -l ${{ github.workspace }}/bin/${{ matrix.target.platform }}/kuzu/ |
72 | 92 |
|
73 |
| -# - name: Build GDExtension Debug Build |
74 |
| -# shell: sh |
75 |
| -# env: |
76 |
| -# SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ |
77 |
| -# run: | |
78 |
| -# scons target=${{ matrix.target-type }} platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} precision=${{ matrix.float-precision }} |
| 93 | + # Setup dependencies |
| 94 | + - name: Setup godot-cpp |
| 95 | + uses: ./godot-cpp/.github/actions/setup-godot-cpp |
| 96 | + with: |
| 97 | + platform: ${{ matrix.target.platform }} |
| 98 | + em-version: 3.1.62 |
79 | 99 |
|
80 |
| -# - name: Save .scons_cache |
81 |
| -# uses: ./godot-cpp/.github/actions/godot-cache-save |
82 |
| -# with: |
83 |
| -# scons-cache: ${{ github.workspace }}/.scons-cache/ |
84 |
| -# cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
| 100 | + # Build GDExtension (with caches) |
85 | 101 |
|
86 |
| -# # Clean up compilation files |
87 |
| -# - name: Windows - Delete compilation files |
88 |
| -# if: ${{ matrix.target.platform == 'windows' }} |
89 |
| -# shell: pwsh |
90 |
| -# run: | |
91 |
| -# Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force |
| 102 | + - name: Restore .scons_cache |
| 103 | + uses: ./godot-cpp/.github/actions/godot-cache-restore |
| 104 | + with: |
| 105 | + scons-cache: ${{ github.workspace }}/.scons-cache/ |
| 106 | + cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
92 | 107 |
|
93 |
| -# # Upload the build |
94 |
| -# - name: Upload Artifact |
95 |
| -# uses: actions/upload-artifact@v4 |
96 |
| -# with: |
97 |
| -# name: godot-cpp-template-${{ matrix.target.platform }}-${{ matrix.target.arch }}-${{ matrix.float-precision }}-${{ matrix.target-type }} |
98 |
| -# path: | |
99 |
| -# ${{ github.workspace }}/bin/** |
| 108 | + - name: Build GDExtension Release Build |
| 109 | + shell: sh |
| 110 | + env: |
| 111 | + SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ |
| 112 | + run: | |
| 113 | + scons target=${{ matrix.target-type }} production=${{ matrix.target-type == 'template_release' && 'yes' || 'no' }} debug_symbols=${{ matrix.target-type == 'template_debug' && 'yes' || 'no' }} platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} precision=${{ matrix.float-precision }} |
100 | 114 |
|
101 |
| -# # Merges all the build artifacts together into a single godot-cpp-template artifact. |
102 |
| -# # If you comment out this step, all the builds will be uploaded individually. |
103 |
| -# merge: |
104 |
| -# runs-on: ubuntu-22.04 |
105 |
| -# needs: build |
106 |
| -# steps: |
107 |
| -# - name: Merge Artifacts |
108 |
| -# uses: actions/upload-artifact/merge@v4 |
109 |
| -# with: |
110 |
| -# name: godot-cpp-template |
111 |
| -# pattern: godot-cpp-template-* |
112 |
| -# delete-merged: true |
| 115 | + - name: Save .scons_cache |
| 116 | + uses: ./godot-cpp/.github/actions/godot-cache-save |
| 117 | + with: |
| 118 | + scons-cache: ${{ github.workspace }}/.scons-cache/ |
| 119 | + cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }} |
| 120 | + |
| 121 | + # Clean up compilation files |
| 122 | + - name: Windows - Delete compilation files |
| 123 | + if: ${{ matrix.target.platform == 'windows' }} |
| 124 | + shell: pwsh |
| 125 | + run: | |
| 126 | + Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force |
| 127 | +
|
| 128 | + # Upload the build |
| 129 | + - name: Upload Artifact |
| 130 | + uses: actions/upload-artifact@v4 |
| 131 | + with: |
| 132 | + name: kuzugd-${{ matrix.target.platform }}-${{ matrix.target.arch }}-${{ matrix.float-precision }}-${{ matrix.target-type }} |
| 133 | + path: | |
| 134 | + ${{ github.workspace }}/bin/** |
| 135 | +
|
| 136 | + # Merges all the build artifacts together into a single kuzugd artifact. |
| 137 | + # If you comment out this step, all the builds will be uploaded individually. |
| 138 | + merge: |
| 139 | + runs-on: ubuntu-22.04 |
| 140 | + needs: build |
| 141 | + steps: |
| 142 | + - name: Merge Artifacts |
| 143 | + uses: actions/upload-artifact/merge@v4 |
| 144 | + with: |
| 145 | + name: kuzugd |
| 146 | + pattern: kuzugd-* |
| 147 | + delete-merged: true |
0 commit comments