Skip to content

Commit 8e8da13

Browse files
committed
Fix release builds for universal-apple-darwin
1 parent 0ec80a7 commit 8e8da13

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ concurrency:
2525

2626
env:
2727
CARGO_TERM_COLOR: always
28-
WORKSPACE_ROOT_MANIFEST_DIR: "/home/runner/work/std/std"
2928
AWS_LC_SYS_PREBUILT_NASM: 1
3029
PLUGIN_REPOSITORY: "std"
3130
PLUGINS: "arithmetic base color comparison connector date-time flow logical metadata numeric random result state string taxonomy trigger value"
@@ -228,7 +227,14 @@ jobs:
228227
uses: dtolnay/rust-toolchain@master
229228
with:
230229
toolchain: stable
231-
target: ${{ matrix.target == 'universal-apple-darwin' && 'aarch64-apple-darwin,x86_64-apple-darwin' || matrix.target }}
230+
target: ${{ matrix.target }}
231+
if: matrix.target != 'universal-apple-darwin'
232+
- name: Install rust toolchain
233+
uses: dtolnay/rust-toolchain@master
234+
with:
235+
toolchain: stable
236+
targets: "x86_64-apple-darwin, aarch64-apple-darwin"
237+
if: matrix.target == 'universal-apple-darwin'
232238
- name: Install bindgen-cli
233239
uses: taiki-e/cache-cargo-install-action@v2
234240
with:
@@ -255,6 +261,21 @@ jobs:
255261
matrix.target == 'riscv64gc-unknown-linux-gnu'
256262
- name: Build Dynamic Link Libraries
257263
run: cargo build --release --target ${{ matrix.target }}
264+
if: matrix.target != 'universal-apple-darwin'
265+
- name: Build Dynamic Link Libraries (universal-apple-darwin)
266+
run: |
267+
cargo build --release --target x86_64-apple-darwin
268+
cargo build --release --target aarch64-apple-darwin
269+
mkdir -p target/universal-apple-darwin/release
270+
for PLUGIN in ${{env.PLUGINS}}; do
271+
lipo \
272+
-create \
273+
target/x86_64-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}} \
274+
target/aarch64-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}} \
275+
-output \
276+
target/universal-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}}
277+
done
278+
if: matrix.target == 'universal-apple-darwin'
258279
- name: Create Release Archive
259280
id: archive
260281
uses: ksm2/archive-action@v1
@@ -392,7 +413,7 @@ jobs:
392413
run: |
393414
for PLUGIN in ${{env.PLUGINS}}; do
394415
# It's important to change into the plugin directory and building each package
395-
cd ${{env.WORKSPACE_ROOT_MANIFEST_DIR}}/plugins/$PLUGIN/crates/plugin
416+
cd "${{ github.workspace }}/plugins/$PLUGIN"
396417
cargo deb -p reactive-graph-${{env.PLUGIN_REPOSITORY}}-$PLUGIN --target=${{ matrix.target }} --deb-revision ${{steps.tag.outputs.tag}}
397418
done
398419
env:
@@ -402,7 +423,7 @@ jobs:
402423
run: |
403424
for PLUGIN in ${{env.PLUGINS}}; do
404425
# It's important to change into the plugin directory and building each package
405-
cd ${{env.WORKSPACE_ROOT_MANIFEST_DIR}}/plugins/$PLUGIN/crates/plugin
426+
cd "${{ github.workspace }}/plugins/$PLUGIN"
406427
cargo deb -p reactive-graph-${{env.PLUGIN_REPOSITORY}}-$PLUGIN --target=${{ matrix.target }} --deb-revision nightly
407428
done
408429
env:

0 commit comments

Comments
 (0)