Skip to content

Commit

Permalink
Update archive filename (#61)
Browse files Browse the repository at this point in the history
* Update archive filename

* Add changeset
  • Loading branch information
Dave Kozma authored Feb 29, 2024
1 parent 2094b2e commit 0decbdc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-timers-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"c2pa-node": patch
---

Update archive filename
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
# This needs to be set so that this works on a Windows runner
shell: bash
env:
ARCHIVE_FILENAME: c2pa-node_${{matrix.target}}-${{ env.PUBLISHED_VERSION || 'dev' }}.zip
ARCHIVE_FILENAME: c2pa-node_${{matrix.target}}-v${{ env.PUBLISHED_VERSION || '-dev' }}.zip
run: |
cd generated
7z a -tzip "${{ env.ARCHIVE_FILENAME }}" c2pa.node
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ package-lock.json
dist
.vscode
.idea
/*.tgz
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const c2pa = createC2pa();

async function read(path, mimeType) {
const buffer = await readFile(path);
const result = await c2pa.read({ buffer });
const result = await c2pa.read({ buffer, mimeType });

if (result) {
const { active_manifest, manifests, validation_status } = result;
Expand All @@ -151,7 +151,7 @@ async function read(path, mimeType) {
}
}

read('my-c2pa-file.jpg', 'image/jpeg');
await read('my-c2pa-file.jpg', 'image/jpeg');
```

### Creating a manifest
Expand Down
Binary file removed c2pa-node-0.5.16.tgz
Binary file not shown.
21 changes: 14 additions & 7 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,19 @@ function getPlatform() {
return 'aarch64-unknown-linux-gnu';
} else if (arch === 'x64' && platform === 'linux') {
return 'x86_64-unknown-linux-gnu';
} else if (arch === 'arm64' && platform === 'darwin') {
// TODO: Support macOS once we have signed builds
// return 'aarch64-apple-darwin';
} else if (arch === 'x64' && platform === 'darwin') {
// TODO: Support macOS once we have signed builds
// return 'x86_64-apple-darwin';
} else if (platform === 'win32') {
return 'x86_64-pc-windows-msvc';
}

// TODO: Support macOS by default once we have signed builds
if (process.env.ENABLE_MAC_BUILDS) {
if (arch === 'arm64' && platform === 'darwin') {
return 'aarch64-apple-darwin';
} else if (arch === 'x64' && platform === 'darwin') {
return 'x86_64-apple-darwin';
}
}

console.log(
`Can not find binary for architecture: ${arch} and platform: ${platform}, attempting to build Rust`,
);
Expand Down Expand Up @@ -187,7 +190,11 @@ async function main() {
return;
}

if (await downloadBinary(appRoot)) {
if (process.env.SKIP_BINARY_DOWNLOAD) {
console.log(
'Skipping prebuilt binary download since SKIP_BINARY_DOWNLOAD is set',
);
} else if (await downloadBinary(appRoot)) {
return;
}

Expand Down

0 comments on commit 0decbdc

Please sign in to comment.