Skip to content

Commit f7ea325

Browse files
committed
chore: fix macos amd64 build
1 parent af91e4f commit f7ea325

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
build:
1313
name: Build ${{ matrix.asset-name }}
1414
runs-on: ${{ matrix.os }}
15-
continue-on-error: true # Don't fail the entire workflow if one target fails
15+
continue-on-error: true # Don't fail the entire workflow if one target fails
1616
strategy:
17-
fail-fast: false # Continue with other builds even if one fails
17+
fail-fast: false # Continue with other builds even if one fails
1818
matrix:
1919
include:
2020
# Linux (x86_64)
@@ -64,14 +64,17 @@ jobs:
6464
targets: ${{ matrix.rust-target }}
6565

6666
# - name: Install cross-compilation dependencies
67-
# if: matrix.cross-compile
68-
# run: |
69-
# sudo apt-get update
70-
# sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross pkg-config
67+
# if: matrix.cross-compile
68+
# run: |
69+
# sudo apt-get update
70+
# sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross pkg-config
7171

7272
- name: Build
73-
continue-on-error: true # Allow individual builds to fail
74-
run: cargo build --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
73+
id: build-main
74+
continue-on-error: true # Allow individual builds to fail
75+
run: |
76+
cargo build --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
77+
cargo build --bin andromeda-installer --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
7578
env:
7679
# Cross-compilation environment variables
7780
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
@@ -80,7 +83,8 @@ jobs:
8083
PKG_CONFIG_ALLOW_CROSS: 1
8184

8285
- name: Build satellites
83-
continue-on-error: true # Allow individual builds to fail
86+
id: build-satellites
87+
continue-on-error: true # Allow individual builds to fail
8488
run: |
8589
cargo build --bin andromeda-run --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
8690
cargo build --bin andromeda-compile --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
@@ -96,6 +100,7 @@ jobs:
96100
PKG_CONFIG_ALLOW_CROSS: 1
97101

98102
- name: Prepare binary
103+
if: steps.build-main.outcome == 'success'
99104
shell: bash
100105
run: |
101106
cd target/${{ matrix.rust-target }}/release/
@@ -104,41 +109,43 @@ jobs:
104109
mv andromeda.exe ${{ matrix.asset-name }}
105110
elif [ -f "andromeda" ]; then
106111
mv andromeda ${{ matrix.asset-name }}
107-
else
108-
echo "Main binary not found, build may have failed"
109-
exit 1
110112
fi
111-
112-
# Prepare satellite binaries
113+
114+
# Prepare installer binary
115+
if [ -f "andromeda-installer.exe" ]; then
116+
mv andromeda-installer.exe ${{ matrix.installer-name }}
117+
elif [ -f "andromeda-installer" ]; then
118+
mv andromeda-installer ${{ matrix.installer-name }}
119+
fi
120+
121+
# Prepare satellite binaries (only if they exist)
113122
for satellite in run compile fmt lint check bundle; do
114123
if [ -f "andromeda-${satellite}.exe" ]; then
115124
# Windows binaries
116125
cp "andromeda-${satellite}.exe" "andromeda-${satellite}-${{ matrix.rust-target }}.exe"
117126
elif [ -f "andromeda-${satellite}" ]; then
118127
# Unix binaries
119128
cp "andromeda-${satellite}" "andromeda-${satellite}-${{ matrix.rust-target }}"
120-
else
121-
echo "Warning: andromeda-${satellite} binary not found"
122129
fi
123130
done
124131
125132
- name: Upload Binary as Artifact
126133
uses: actions/upload-artifact@v4
127-
if: success() # Only upload if binary was prepared successfully
134+
if: steps.build-main.outcome == 'success'
128135
with:
129136
name: ${{ matrix.asset-name }}
130137
path: target/${{ matrix.rust-target }}/release/${{ matrix.asset-name }}
131138

132139
- name: Upload Installer as Artifact
133140
uses: actions/upload-artifact@v4
134-
if: success() # Only upload if installer was prepared successfully
141+
if: steps.build-main.outcome == 'success' && hashFiles(format('target/{0}/release/{1}', matrix.rust-target, matrix.installer-name)) != ''
135142
with:
136143
name: ${{ matrix.installer-name }}
137144
path: target/${{ matrix.rust-target }}/release/${{ matrix.installer-name }}
138145

139146
- name: Upload Satellite Binaries as Artifacts
140147
uses: actions/upload-artifact@v4
141-
if: success()
148+
if: steps.build-satellites.outcome == 'success'
142149
with:
143150
name: satellites-${{ matrix.rust-target }}
144151
path: |

0 commit comments

Comments
 (0)