Skip to content

Commit afadc2f

Browse files
committed
Fix GitHub Actions workflow issues
- Add error handling for binary file existence checks in build workflows - Fix dependency installation with --locked flag for reproducible builds - Add proper conditional execution for build jobs based on check results - Improve error handling in macOS and Linux build processes - Fix duplicate if statements in release job
1 parent 2721cec commit afadc2f

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

.github/workflows/build-linux.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,18 @@ jobs:
5959
- name: Create release artifacts
6060
run: |
6161
mkdir -p release
62-
cp target/x86_64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-x86_64-unknown-linux-gnu
63-
cp target/aarch64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-aarch64-unknown-linux-gnu
62+
if [ -f target/x86_64-unknown-linux-gnu/release/rbx-studio-mcp ]; then
63+
cp target/x86_64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-x86_64-unknown-linux-gnu
64+
else
65+
echo "Error: x86_64 binary not found"
66+
exit 1
67+
fi
68+
if [ -f target/aarch64-unknown-linux-gnu/release/rbx-studio-mcp ]; then
69+
cp target/aarch64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-aarch64-unknown-linux-gnu
70+
else
71+
echo "Error: aarch64 binary not found"
72+
exit 1
73+
fi
6474
chmod +x release/*
6575
6676
- name: Create checksums

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
build-macos:
5353
runs-on: macos-latest
5454
needs: [selene, stylua, clippy]
55+
if: always() && (needs.selene.result == 'success' && needs.stylua.result == 'success' && needs.clippy.result == 'success')
5556
steps:
5657
- uses: actions/checkout@v4
5758
- name: Install Rust
@@ -67,7 +68,16 @@ jobs:
6768
cargo bundle --release --target aarch64-apple-darwin
6869
# Create universal binary
6970
mkdir -p "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/"
70-
lipo -create target/aarch64-apple-darwin/release/rbx-studio-mcp target/x86_64-apple-darwin/release/rbx-studio-mcp -output "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp"
71+
if [ -f "target/aarch64-apple-darwin/release/rbx-studio-mcp" ] && [ -f "target/x86_64-apple-darwin/release/rbx-studio-mcp" ]; then
72+
lipo -create target/aarch64-apple-darwin/release/rbx-studio-mcp target/x86_64-apple-darwin/release/rbx-studio-mcp -output "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp"
73+
else
74+
echo "Warning: One or both binaries not found, copying available binary"
75+
if [ -f "target/aarch64-apple-darwin/release/rbx-studio-mcp" ]; then
76+
cp target/aarch64-apple-darwin/release/rbx-studio-mcp "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp"
77+
elif [ -f "target/x86_64-apple-darwin/release/rbx-studio-mcp" ]; then
78+
cp target/x86_64-apple-darwin/release/rbx-studio-mcp "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp"
79+
fi
80+
fi
7181
- name: Sign and Notarize macOS binary
7282
run: |
7383
echo "Skipping macOS signing - signing script not found"
@@ -88,6 +98,7 @@ jobs:
8898
build-windows:
8999
runs-on: windows-latest
90100
needs: [selene, stylua, clippy]
101+
if: always() && (needs.selene.result == 'success' && needs.stylua.result == 'success' && needs.clippy.result == 'success')
91102
steps:
92103
- uses: actions/checkout@v4
93104
- name: Install Rust
@@ -122,8 +133,8 @@ jobs:
122133

123134
release:
124135
runs-on: ubuntu-latest
125-
if: ${{ github.ref_name == github.event.repository.default_branch }}
126136
needs: [build-macos, build-windows]
137+
if: ${{ github.ref_name == github.event.repository.default_branch }} && always() && (needs.build-macos.result == 'success' && needs.build-windows.result == 'success')
127138
steps:
128139
- name: Create output directory
129140
run: mkdir -p output

.github/workflows/checks.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ jobs:
7474
7575
- name: Install Selene
7676
run: |
77-
if ! command -v selene &> /dev/null; then
78-
cargo install selene
79-
fi
77+
cargo install selene --locked
8078
8179
- name: Run Selene
8280
working-directory: plugin
@@ -103,9 +101,7 @@ jobs:
103101
104102
- name: Install StyLua
105103
run: |
106-
if ! command -v stylua &> /dev/null; then
107-
cargo install stylua --features luau
108-
fi
104+
cargo install stylua --features luau --locked
109105
110106
- name: Run StyLua
111107
working-directory: plugin

0 commit comments

Comments
 (0)