Skip to content

Commit

Permalink
fix: release url (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored May 3, 2023
1 parent 789f92e commit ed15bca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ jobs:
components: rustfmt, clippy
- name: Build
run: cargo build --locked --release
- name: Build Example
- name: Build Example (debug)
working-directory: ./example
run: |
cd example
deno run -A ../cli.ts
deno test --no-check -A --unstable
deno test -A --unstable
- name: Build Example (release)
working-directory: ./example
shell: bash
run: |
rm -rf target
deno run -A ../cli.ts --release=../target/release
deno test -A --unstable
15 changes: 3 additions & 12 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,14 @@ import { dlopen, FetchOptions } from "https://deno.land/x/[email protected]/mod.ts";
let uri = url.toString();
if (!uri.endsWith("/")) uri += "/";
let darwin: string | { aarch64: string; x86_64: string } = uri + "lib${name}.dylib";
if (url.protocol !== "file:") {
// Assume that remote assets follow naming scheme
// for each macOS artifact.
darwin = {
aarch64: uri + "lib${name}_arm64.dylib",
x86_64: uri + "lib${name}.dylib",
}
}
let darwin: string | { aarch64: string; x86_64: string } = uri;
const opts: FetchOptions = {
name: "${name}",
url: {
darwin,
windows: uri + "${name}.dll",
linux: uri + "lib${name}.so",
windows: uri,
linux: uri,
},
cache: ${!!options?.release ? '"use"' : '"reloadAll"'},
};
Expand Down
16 changes: 3 additions & 13 deletions example/bindings/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,20 @@ function readPointer(v: any): Uint8Array {
return buf
}

const url = new URL("../target/debug", import.meta.url)
const url = new URL("../target/release", import.meta.url)

import { dlopen, FetchOptions } from "https://deno.land/x/[email protected]/mod.ts"
let uri = url.toString()
if (!uri.endsWith("/")) uri += "/"

let darwin: string | { aarch64: string; x86_64: string } = uri
+ "libdeno_bindgen_test.dylib"

if (url.protocol !== "file:") {
// Assume that remote assets follow naming scheme
// for each macOS artifact.
darwin = {
aarch64: uri + "libdeno_bindgen_test_arm64.dylib",
x86_64: uri + "libdeno_bindgen_test.dylib",
}
}

const opts: FetchOptions = {
name: "deno_bindgen_test",
url: {
darwin,
windows: uri + "deno_bindgen_test.dll",
linux: uri + "libdeno_bindgen_test.so",
windows: uri,
linux: uri,
},
cache: "use",
}
Expand Down

0 comments on commit ed15bca

Please sign in to comment.