1+ name : Build with bob
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ ubuntu_runner :
7+ required : false
8+ type : string
9+ description : ' Which Ubuntu runner should use'
10+ default : ubuntu-latest
11+ macos_runner :
12+ required : false
13+ type : string
14+ description : ' Which MacOS runner should use'
15+ default : ' macOSlatest'
16+ windows_runner :
17+ required : false
18+ type : string
19+ description : ' Which Windows runner should use'
20+ default : windows-latest
21+ build_server :
22+ required : false
23+ type : string
24+ description : ' Buld server url'
25+ default : ' https://build-stage.defold.com'
26+ channel :
27+ required : false
28+ type : string
29+ description : ' Which Defold version use to build. Possible values: alpha, beta, stable'
30+ default : alpha
31+ bob_version_filename :
32+ required : false
33+ type : string
34+ description : ' JSON filename withi Bob versions'
35+ default : ' info.json'
36+ additonal_build_options :
37+ required : false
38+ type : string
39+ description : ' Additional options passed to build command'
40+ default : ' --archive'
41+ additonal_bundle_options :
42+ required : false
43+ type : string
44+ description : ' Additional options passed to bundle command'
45+
46+ jobs :
47+ build_with_bob :
48+ strategy :
49+ matrix :
50+ platform : [armv7-android, x86_64-linux, js-web]
51+ runs-on : ${{ inputs.ubuntu_runner }}
52+
53+ name : Build
54+ steps :
55+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56+ - uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
57+ with :
58+ java-version : ' 21.0.5+11.0.LTS'
59+ architecture : x64
60+ distribution : ' temurin'
61+
62+ - name : Get Defold version
63+ id : defold_version
64+ run : |
65+ TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'`
66+ echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT
67+ echo "Found version ${TMPVAR}"
68+
69+ - name : Download bob.jar
70+ run : |
71+ wget -q http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar
72+ java -jar bob.jar --version
73+
74+ - name : Installing Shared Library Dependencies
75+ run : |
76+ echo "Remove after we've fixed the headless build for plugins"
77+ sudo apt-get update
78+ sudo apt-get install -y libopenal-dev freeglut3-dev libgl-dev libglx-dev libegl-dev
79+
80+ - name : Resolve libraries
81+ run : java -jar bob.jar resolve
82+ - name : Build
83+ run : java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
84+ - name : Bundle
85+ run : java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
86+
87+ build_with_bob_windows :
88+ strategy :
89+ matrix :
90+ platform : [x86_64-win32, x86-win32]
91+ runs-on : ${{ inputs.windows_runner }}
92+
93+ name : Build
94+ steps :
95+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
96+ - uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
97+ with :
98+ java-version : ' 21.0.5+11.0.LTS'
99+ architecture : x64
100+ distribution : ' temurin'
101+
102+ - name : Get Defold version
103+ id : defold_version
104+ run : |
105+ TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'`
106+ echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT
107+ echo "Found version ${TMPVAR}"
108+ shell : bash
109+
110+ - name : Download bob.jar
111+ run : |
112+ curl -s -o bob.jar http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar
113+ java -jar bob.jar --version
114+
115+ - name : Resolve libraries
116+ run : java -jar bob.jar resolve
117+ - name : Build
118+ run : java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
119+ - name : Bundle
120+ run : java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
121+
122+ # macOS is not technically needed for building, but we want to test bundling as well, since we're also testing the manifest merging
123+ build_with_bob_macos :
124+ strategy :
125+ matrix :
126+ platform : [arm64-macos, x86_64-macos]
127+ runs-on : macOS-latest
128+
129+ name : Build
130+ steps :
131+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
132+ - uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
133+ with :
134+ java-version : ' 21.0.5+11.0.LTS'
135+ architecture : x64
136+ distribution : ' temurin'
137+
138+ - name : Get Defold version
139+ id : defold_version
140+ run : |
141+ TMPVAR=`curl -s http://d.defold.com/${{ inputs.channel }}/${{ inputs.bob_version_filename }} | jq -r '.sha1'`
142+ echo "defold_version=${TMPVAR}" >> $GITHUB_OUTPUT
143+ echo "Found version ${TMPVAR}"
144+
145+ - name : Download bob.jar
146+ run : |
147+ wget -q http://d.defold.com/archive/${{ inputs.channel }}/${{ steps.defold_version.outputs.defold_version }}/bob/bob.jar
148+ java -jar bob.jar --version
149+
150+ - name : Resolve libraries
151+ run : java -jar bob.jar resolve
152+ - name : Build
153+ run : java -jar bob.jar --platform=${{ matrix.platform }} build --build-server=${{ inputs.build_server }} ${{ inputs.additonal_build_options }}
154+ - name : Bundle
155+ run : java -jar bob.jar --platform=${{ matrix.platform }} bundle ${{ inputs.additonal_bundle_options }}
0 commit comments