-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (65 loc) · 2.07 KB
/
ci.yml
File metadata and controls
80 lines (65 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: OMC CI/CD
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnai/rust-toolchain@stable
with:
toolchain: stable
- name: Build workspace
run: cargo build --release --workspace
- name: Run tests
run: cargo test --workspace
- name: Upload FFI binary
uses: actions/upload-artifact@v4
with:
name: libomnimcode_ffi.so
path: target/release/libomnimcode_ffi.so
- name: Upload core binary
uses: actions/upload-artifact@v4
with:
name: omnimcode-core
path: target/release/omnimcode-core
package-unity:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download FFI binary
uses: actions/download-artifact@v4
with:
name: libomnimcode_ffi.so
path: packages/OMNIcode-Unity/Runtime/Plugins/x86_64/
- name: Create Unity package
run: |
cd packages
zip -r OMNIcode-Unity.unitypackage OMNIcode-Unity/
- name: Upload Unity package
uses: actions/upload-artifact@v4
with:
name: OMNIcode-Unity-Package
path: packages/OMNIcode-Unity.unitypackage
publish-crates:
needs: build-and-test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnai/rust-toolchain@stable
- name: Publish to crates.io
run: |
cargo publish -p omnimcode-core --token ${{ secrets.CRATES_IO_TOKEN }}
cargo publish -p omnimcode-ffi --token ${{ secrets.CRATES_IO_TOKEN }}
cargo publish -p omnimcode-python --token ${{ secrets.CRATES_IO_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}