-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (128 loc) · 3.97 KB
/
rust.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Rust_lib
on:
# push:
# branches: [ "main" ]
release:
types:
- created
env:
CARGO_TERM_COLOR: always
jobs:
windows_job:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build and Package Libraries (Windows)
run: |
# Build for Windows target (using Windows commands)
cargo build --release
shell: powershell
working-directory: ${{ github.workspace }}
- name: Build Archive
run: |
mkdir hallr
mkdir hallr/hallr
mkdir hallr/hallr/lib
cp blender_addon/.hallr hallr
cp blender_addon/*.py hallr/hallr
cp target/release/hallr.dll hallr/hallr/lib/
working-directory: ${{ github.workspace }}
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: hallr
path: hallr
linux_job:
runs-on: ubuntu-latest
needs: windows_job
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare Archive
run: mkdir hallr
working-directory: ${{ github.workspace }}
- name: Download Previous Artifacts
uses: actions/download-artifact@v3
with:
name: hallr
path: hallr
- name: Build and Package Libraries (Linux)
run: |
# Build for Linux target (using Bash)
cargo build --release
shell: bash
working-directory: ${{ github.workspace }}
- name: Append to Archive
run: |
# Append Linux artifacts to the existing archive
cp target/release/libhallr.so hallr/hallr/lib/
working-directory: ${{ github.workspace }}
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: hallr
path: hallr
macos_x86_job:
runs-on: macos-latest
needs: linux_job
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare Archive
run: mkdir hallr
working-directory: ${{ github.workspace }}
- name: Download Previous Artifacts
uses: actions/download-artifact@v3
with:
name: hallr
path: hallr
- name: Build and Package Libraries (macOS)
run: |
# Build for macOS x86 target (using Bash)
cargo build --release
shell: bash
working-directory: ${{ github.workspace }}
- name: Append to Archive
run: cp target/release/libhallr.dylib hallr/hallr/lib/
working-directory: ${{ github.workspace }}
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: hallr
path: hallr
macos_arm_job:
runs-on: macos-latest # we are still using x86 mac here, I need sponsors to pay for macos-latest-xl
needs: macos_x86_job
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare Archive
run: mkdir hallr
working-directory: ${{ github.workspace }}
- name: Download Previous Artifacts
uses: actions/download-artifact@v3
with:
name: hallr
path: hallr
- name: Build and Package Libraries (macOS)
run: |
# Build for macOS arm target (using Bash)
cargo build --release
shell: bash
working-directory: ${{ github.workspace }}
- name: Build fat library
run: |
#lipo -create target/release/libhallr.dylib lib/libhallr.dylib -output target/libhallr.dylib
#mv target/libhallr.dylib target/release
working-directory: ${{ github.workspace }}
- name: Append to Archive
run: |
# Append macOS artifacts to the existing archive
cp target/release/libhallr.dylib hallr/hallr/lib/
working-directory: ${{ github.workspace }}
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: hallr
path: hallr