Skip to content

Commit edc2f4b

Browse files
authored
fix(build): use unique platform-specific binary names for releases (#38)
## Summary Fixes GitHub Release upload failures caused by all binaries having the same name (`sentry` or `sentry.exe`). Binary names now include the platform suffix to ensure uniqueness: - `sentry-darwin-arm64` - `sentry-darwin-x64` - `sentry-linux-arm64` - `sentry-linux-x64` - `sentry-windows-x64.exe` These names also satisfy the existing `.craft.yml` requirement pattern `/^sentry-.+$/`.
1 parent 7248411 commit edc2f4b

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ jobs:
114114
shell: bash
115115
run: |
116116
if [[ "${{ matrix.target }}" == "windows-x64" ]]; then
117-
./dist/sentry-windows-x64/bin/sentry.exe --help
117+
./dist-bin/sentry-windows-x64.exe --help
118118
else
119-
./dist/sentry-${{ matrix.target }}/bin/sentry --help
119+
./dist-bin/sentry-${{ matrix.target }} --help
120120
fi
121121
- name: Upload artifact
122122
uses: actions/upload-artifact@v4
123123
with:
124124
name: sentry-${{ matrix.target }}
125-
path: dist/sentry-*/bin/sentry*
125+
path: dist-bin/sentry-*
126126

127127
build-npm:
128128
name: Build npm Package (Node ${{ matrix.node }})

script/build.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
* bun run script/build.ts --target darwin-x64 # Build for specific target (cross-compile)
1212
*
1313
* Output structure:
14-
* dist/
15-
* sentry-darwin-arm64/
16-
* bin/sentry
17-
* sentry-darwin-x64/
18-
* bin/sentry
19-
* ...
14+
* dist-bin/
15+
* sentry-darwin-arm64
16+
* sentry-darwin-x64
17+
* sentry-linux-arm64
18+
* sentry-linux-x64
19+
* sentry-windows-x64.exe
2020
*/
2121

2222
import { $ } from "bun";
@@ -55,13 +55,14 @@ function getBunTarget(target: BuildTarget): string {
5555
/** Build for a single target */
5656
async function buildTarget(target: BuildTarget): Promise<boolean> {
5757
const packageName = getPackageName(target);
58-
const binaryName = target.os === "win32" ? "sentry.exe" : "sentry";
59-
const outfile = `dist/${packageName}/bin/${binaryName}`;
58+
const extension = target.os === "win32" ? ".exe" : "";
59+
const binaryName = `${packageName}${extension}`;
60+
const outfile = `dist-bin/${binaryName}`;
6061

6162
console.log(` Building ${packageName}...`);
6263

6364
// Create directory structure
64-
await $`mkdir -p dist/${packageName}/bin`;
65+
await $`mkdir -p dist-bin`;
6566

6667
const result = await Bun.build({
6768
entrypoints: ["./src/bin.ts"],
@@ -159,8 +160,8 @@ async function build(): Promise<void> {
159160
console.log(`\nBuilding for ${targets.length} targets`);
160161
}
161162

162-
// Clean dist directory
163-
await $`rm -rf dist`;
163+
// Clean output directory
164+
await $`rm -rf dist-bin`;
164165

165166
console.log("");
166167

0 commit comments

Comments
 (0)