Skip to content

Commit 8647cf2

Browse files
Merge pull request #55 from orca-app/c-tooling
C tooling: split the user tooling and the dev tooling. Provide a native tool and precompiled binaries for all the user workflows.
2 parents dac2644 + 1626655 commit 8647cf2

File tree

2,250 files changed

+597851
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,250 files changed

+597851
-1003
lines changed

.github/workflows/build-runtime.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: build-runtime
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-win:
11+
runs-on: windows-2022
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Build
20+
shell: cmd
21+
run: |
22+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
23+
orcadev.bat build-runtime --release
24+
25+
- name: Tarball
26+
shell: cmd
27+
run: |
28+
rename build orca-runtime-win
29+
rename src src-win
30+
tar -czf orca-runtime-win.tar.gz orca-runtime-win src-win
31+
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: orca-runtime-win
35+
path: orca-runtime-win.tar.gz
36+
37+
build-macos-x64:
38+
runs-on: macos-13
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.10'
45+
46+
- name: Build
47+
run: |
48+
./orcadev build-runtime --release
49+
mv build orca-runtime-mac-x64
50+
mv src src-mac-x64
51+
tar --format=ustar -czf orca-runtime-mac-x64.tar.gz orca-runtime-mac-x64 src-mac-x64
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: orca-runtime-mac-x64
56+
path: orca-runtime-mac-x64.tar.gz
57+
58+
build-macos-arm64:
59+
runs-on: macos-14
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.10'
66+
67+
- name: Build
68+
run: |
69+
./orcadev build-runtime --release
70+
mv build orca-runtime-mac-arm64
71+
mv src src-mac-arm64
72+
tar --format=ustar -czf orca-runtime-mac-arm64.tar.gz orca-runtime-mac-arm64 src-mac-arm64
73+
74+
- uses: actions/upload-artifact@v4
75+
with:
76+
name: orca-runtime-mac-arm64
77+
path: orca-runtime-mac-arm64.tar.gz

.github/workflows/build-tool.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: build-tool
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-win:
11+
runs-on: windows-2022
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Build
20+
shell: cmd
21+
run: |
22+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
23+
orcadev.bat build-tool --release --version ${{github.ref_name}}
24+
25+
- uses: actions/upload-artifact@v4
26+
with:
27+
name: orca-win
28+
path: build/bin/orca.exe
29+
30+
build-macos-x64:
31+
runs-on: macos-13
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: actions/setup-python@v4
36+
with:
37+
python-version: '3.10'
38+
39+
- name: Build
40+
run: ./orcadev build-tool --release --version ${{github.ref_name}}
41+
42+
# NOTE: tar is needed to maintain executable file permissions
43+
- name: Tar
44+
run: |
45+
cp build/bin/orca orca
46+
tar -czf orca-mac-x64.tar.gz orca
47+
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: orca-mac-x64
51+
path: orca-mac-x64.tar.gz
52+
53+
build-macos-arm64:
54+
runs-on: macos-14
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: actions/setup-python@v4
59+
with:
60+
python-version: '3.10'
61+
62+
- name: Build
63+
run: ./orcadev build-tool --release --version ${{github.ref_name}}
64+
65+
# NOTE: tar is needed to maintain executable file permissions
66+
- name: Tar
67+
run: |
68+
cp build/bin/orca orca
69+
tar -czf orca-mac-arm64.tar.gz orca
70+
71+
- uses: actions/upload-artifact@v4
72+
with:
73+
name: orca-mac-arm64
74+
path: orca-mac-arm64.tar.gz
75+
76+
mac-make-universal:
77+
runs-on: macos-latest
78+
needs: [build-macos-x64, build-macos-arm64]
79+
steps:
80+
- name: Check out
81+
uses: actions/checkout@v4
82+
83+
- uses: actions/download-artifact@v4
84+
with:
85+
name: orca-mac-x64
86+
87+
- uses: actions/download-artifact@v4
88+
with:
89+
name: orca-mac-arm64
90+
91+
- name: Untar
92+
run: |
93+
tar -xzf orca-mac-x64.tar.gz
94+
mv orca orca-mac-x64
95+
tar -xzf orca-mac-arm64.tar.gz
96+
mv orca orca-mac-arm64
97+
98+
- name: Make universal binary
99+
run: |
100+
chmod +x orca-mac-x64
101+
chmod +x orca-mac-arm64
102+
lipo -create orca-mac-x64 orca-mac-arm64 -output orca
103+
104+
- name: Tar
105+
run: |
106+
tar --format=ustar -czf orca-mac-universal.tar.gz orca
107+
108+
- uses: actions/upload-artifact@v4
109+
with:
110+
name: orca-mac-universal
111+
path: orca-mac-universal.tar.gz

.github/workflows/create-release.yaml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: create-release
2+
3+
on:
4+
push:
5+
tags: [ "v[0-9]+.[0-9]+.[0-9]+", "test-release**" ]
6+
7+
jobs:
8+
build-tool:
9+
uses: ./.github/workflows/build-tool.yaml
10+
11+
build-runtime:
12+
uses: ./.github/workflows/build-runtime.yaml
13+
14+
release:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
needs: [build-tool, build-runtime]
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: repo
23+
sparse-checkout: |
24+
resources
25+
26+
- uses: actions/download-artifact@v4
27+
with:
28+
# when name is not specified, all artifacts from this run will be downloaded
29+
path: artifacts
30+
merge-multiple: true
31+
32+
- name: Package CLI Tool
33+
run: |
34+
mkdir releases
35+
cp artifacts/orca.exe releases
36+
cp artifacts/orca-mac-universal.tar.gz releases/orca-mac.tar.gz
37+
38+
- name: Package Windows Release
39+
run: |
40+
mkdir -p orca-sdk-windows/bin
41+
mkdir -p orca-sdk-windows/orca-libc
42+
mkdir -p orca-sdk-windows/resources
43+
mkdir -p orca-sdk-windows/src
44+
# gather fonts
45+
cp repo/resources/* orca-sdk-windows/resources
46+
# gather cli-tool
47+
cp artifacts/orca.exe orca-sdk-windows/bin
48+
# gather runtime
49+
cd artifacts
50+
tar -xzf orca-runtime-win.tar.gz
51+
cd ..
52+
cp artifacts/orca-runtime-win/bin/runtime.obj orca-sdk-windows/bin
53+
cp artifacts/orca-runtime-win/bin/orca.dll orca-sdk-windows/bin
54+
cp artifacts/orca-runtime-win/bin/orca.dll.lib orca-sdk-windows/bin
55+
cp artifacts/orca-runtime-win/bin/liborca_wasm.a orca-sdk-windows/bin
56+
cp artifacts/orca-runtime-win/bin/wasm3.lib orca-sdk-windows/bin
57+
cp artifacts/orca-runtime-win/bin/libEGL.dll orca-sdk-windows/bin
58+
cp artifacts/orca-runtime-win/bin/libGLESv2.dll orca-sdk-windows/bin
59+
# gather source code
60+
cp -r artifacts/src-win/* orca-sdk-windows/src
61+
62+
# TODO(shaw): gather orca-libc once it is built by ci
63+
64+
# generate checksum file
65+
find orca-sdk-windows -type f -exec sha1sum {} + | LC_ALL=C sort | sha1sum | cut -z -f 1 -d " " > sha1.sum
66+
# create release tarball
67+
tar --format=ustar -czf orca-sdk-windows.tar.gz orca-sdk-windows sha1.sum
68+
mv orca-sdk-windows.tar.gz releases
69+
70+
- name: Package Mac x64 Release
71+
run: |
72+
mkdir -p orca-sdk-mac-x64/bin
73+
mkdir -p orca-sdk-mac-x64/orca-libc
74+
mkdir -p orca-sdk-mac-x64/resources
75+
mkdir -p orca-sdk-mac-x64/src
76+
# gather fonts
77+
cp repo/resources/* orca-sdk-mac-x64/resources
78+
# gather cli-tool
79+
cd artifacts
80+
tar -xzf orca-mac-universal.tar.gz
81+
cd ..
82+
cp artifacts/orca orca-sdk-mac-x64/bin
83+
# gather runtime
84+
cd artifacts
85+
tar -xzf orca-runtime-mac-x64.tar.gz
86+
cd ..
87+
cp artifacts/orca-runtime-mac-x64/bin/orca_runtime orca-sdk-mac-x64/bin
88+
cp artifacts/orca-runtime-mac-x64/bin/liborca.dylib orca-sdk-mac-x64/bin
89+
cp artifacts/orca-runtime-mac-x64/bin/liborca_wasm.a orca-sdk-mac-x64/bin
90+
cp artifacts/orca-runtime-mac-x64/bin/libEGL.dylib orca-sdk-mac-x64/bin
91+
cp artifacts/orca-runtime-mac-x64/bin/libGLESv2.dylib orca-sdk-mac-x64/bin
92+
cp artifacts/orca-runtime-mac-x64/bin/mtl_renderer.metallib orca-sdk-mac-x64/bin
93+
# gather source code
94+
cp -r artifacts/src-mac-x64/* orca-sdk-mac-x64/src
95+
96+
# TODO(shaw): gather orca-libc once it is built by ci
97+
98+
# generate checksum file
99+
find orca-sdk-mac-x64 -type f -exec sha1sum {} + | LC_ALL=C sort | sha1sum | cut -z -f 1 -d " " > sha1.sum
100+
# create release tarball
101+
tar --format=ustar -czf orca-sdk-mac-x64.tar.gz orca-sdk-mac-x64 sha1.sum
102+
mv orca-sdk-mac-x64.tar.gz releases
103+
104+
- name: Package Mac arm64 Release
105+
run: |
106+
mkdir -p orca-sdk-mac-arm64/bin
107+
mkdir -p orca-sdk-mac-arm64/orca-libc
108+
mkdir -p orca-sdk-mac-arm64/resources
109+
mkdir -p orca-sdk-mac-arm64/src
110+
# gather fonts
111+
cp repo/resources/* orca-sdk-mac-arm64/resources
112+
# gather cli-tool
113+
cd artifacts
114+
tar -xzf orca-mac-universal.tar.gz
115+
cd ..
116+
cp artifacts/orca orca-sdk-mac-arm64/bin
117+
# gather runtime
118+
cd artifacts
119+
tar -xzf orca-runtime-mac-arm64.tar.gz
120+
cd ..
121+
cp artifacts/orca-runtime-mac-arm64/bin/orca_runtime orca-sdk-mac-arm64/bin
122+
cp artifacts/orca-runtime-mac-arm64/bin/liborca.dylib orca-sdk-mac-arm64/bin
123+
cp artifacts/orca-runtime-mac-arm64/bin/liborca_wasm.a orca-sdk-mac-arm64/bin
124+
cp artifacts/orca-runtime-mac-arm64/bin/libEGL.dylib orca-sdk-mac-arm64/bin
125+
cp artifacts/orca-runtime-mac-arm64/bin/libGLESv2.dylib orca-sdk-mac-arm64/bin
126+
cp artifacts/orca-runtime-mac-arm64/bin/mtl_renderer.metallib orca-sdk-mac-arm64/bin
127+
# gather source code
128+
cp -r artifacts/src-mac-arm64/* orca-sdk-mac-arm64/src
129+
130+
# TODO(shaw): gather orca-libc once it is built by ci
131+
132+
# generate checksum file
133+
find orca-sdk-mac-arm64 -type f -exec sha1sum {} + | LC_ALL=C sort | sha1sum | cut -z -f 1 -d " " > sha1.sum
134+
# create release tarball
135+
tar --format=ustar -czf orca-sdk-mac-arm64.tar.gz orca-sdk-mac-arm64 sha1.sum
136+
mv orca-sdk-mac-arm64.tar.gz releases
137+
138+
- uses: ncipollo/release-action@v1
139+
with:
140+
artifacts: "releases/*"

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@ src/ext/angle
4646
sketches/*/bin
4747

4848
.cache
49+
50+
tags
51+
52+
src/ext/curl/builds/
53+
src/ext/curl/winbuild/*.inc
54+
src/ext/curl/winbuild/*.idb
55+
src/ext/zlib/build/
56+

.orcaroot

Lines changed: 0 additions & 3 deletions
This file was deleted.

.orcasource

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
You are currently at the root of the Orca source. Welcome.
2+
3+
This file exists to help the Orca dev tooling find the project root directory from anywhere inside.

0 commit comments

Comments
 (0)