Skip to content

Commit 6337fc0

Browse files
joskeclaude
andcommitted
fix Windows build: make cargo visible in msys2 shell
The Rust toolchain is installed in the Windows PATH but not visible from the msys2 shell. Explicitly add cargo to PATH and use per-step shell selection instead of a job-level default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 030f5bd commit 6337fc0

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ jobs:
129129
runs-on: windows-latest
130130
permissions:
131131
contents: write
132-
defaults:
133-
run:
134-
shell: msys2 {0}
135132
steps:
136133
- name: Setup MSYS2
137134
uses: msys2/setup-msys2@v2
@@ -147,14 +144,19 @@ jobs:
147144
- name: Install Rust
148145
uses: actions-rust-lang/setup-rust-toolchain@v1
149146
- name: Build release binary
150-
run: cargo build --release
147+
shell: msys2 {0}
148+
run: |
149+
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH"
150+
cargo build --release
151151
- name: Bundle binary with DLLs
152+
shell: msys2 {0}
152153
run: |
153154
mkdir -p dist
154155
cp target/release/mergers.exe dist/
155156
# Copy all required DLLs from MSYS2
156157
ldd target/release/mergers.exe | grep "ucrt64" | awk '{print $3}' | xargs -I{} cp {} dist/
157158
# Copy GtkSourceView language specs and styles
159+
mkdir -p dist/share
158160
cp -r /$MSYSTEM/share/gtksourceview-5 dist/share/gtksourceview-5
159161
# Copy GTK schema files
160162
mkdir -p dist/share/glib-2.0/schemas
@@ -164,6 +166,7 @@ jobs:
164166
cp -r /$MSYSTEM/share/icons/hicolor dist/share/icons/
165167
cp -r /$MSYSTEM/share/icons/Adwaita dist/share/icons/ 2>/dev/null || true
166168
- name: Create zip
169+
shell: msys2 {0}
167170
run: |
168171
cd dist
169172
7z a ../mergers-windows-x86_64.zip ./*

0 commit comments

Comments
 (0)