Skip to content

Commit 0decbdc

Browse files
author
Dave Kozma
authored
Update archive filename (#61)
* Update archive filename * Add changeset
1 parent 2094b2e commit 0decbdc

File tree

6 files changed

+23
-10
lines changed

6 files changed

+23
-10
lines changed

.changeset/dirty-timers-shout.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"c2pa-node": patch
3+
---
4+
5+
Update archive filename

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
# This needs to be set so that this works on a Windows runner
135135
shell: bash
136136
env:
137-
ARCHIVE_FILENAME: c2pa-node_${{matrix.target}}-${{ env.PUBLISHED_VERSION || 'dev' }}.zip
137+
ARCHIVE_FILENAME: c2pa-node_${{matrix.target}}-v${{ env.PUBLISHED_VERSION || '-dev' }}.zip
138138
run: |
139139
cd generated
140140
7z a -tzip "${{ env.ARCHIVE_FILENAME }}" c2pa.node

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ package-lock.json
77
dist
88
.vscode
99
.idea
10+
/*.tgz

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const c2pa = createC2pa();
141141

142142
async function read(path, mimeType) {
143143
const buffer = await readFile(path);
144-
const result = await c2pa.read({ buffer });
144+
const result = await c2pa.read({ buffer, mimeType });
145145

146146
if (result) {
147147
const { active_manifest, manifests, validation_status } = result;
@@ -151,7 +151,7 @@ async function read(path, mimeType) {
151151
}
152152
}
153153

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

157157
### Creating a manifest

c2pa-node-0.5.16.tgz

-43.5 KB
Binary file not shown.

scripts/postinstall.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ function getPlatform() {
5656
return 'aarch64-unknown-linux-gnu';
5757
} else if (arch === 'x64' && platform === 'linux') {
5858
return 'x86_64-unknown-linux-gnu';
59-
} else if (arch === 'arm64' && platform === 'darwin') {
60-
// TODO: Support macOS once we have signed builds
61-
// return 'aarch64-apple-darwin';
62-
} else if (arch === 'x64' && platform === 'darwin') {
63-
// TODO: Support macOS once we have signed builds
64-
// return 'x86_64-apple-darwin';
6559
} else if (platform === 'win32') {
6660
return 'x86_64-pc-windows-msvc';
6761
}
6862

63+
// TODO: Support macOS by default once we have signed builds
64+
if (process.env.ENABLE_MAC_BUILDS) {
65+
if (arch === 'arm64' && platform === 'darwin') {
66+
return 'aarch64-apple-darwin';
67+
} else if (arch === 'x64' && platform === 'darwin') {
68+
return 'x86_64-apple-darwin';
69+
}
70+
}
71+
6972
console.log(
7073
`Can not find binary for architecture: ${arch} and platform: ${platform}, attempting to build Rust`,
7174
);
@@ -187,7 +190,11 @@ async function main() {
187190
return;
188191
}
189192

190-
if (await downloadBinary(appRoot)) {
193+
if (process.env.SKIP_BINARY_DOWNLOAD) {
194+
console.log(
195+
'Skipping prebuilt binary download since SKIP_BINARY_DOWNLOAD is set',
196+
);
197+
} else if (await downloadBinary(appRoot)) {
191198
return;
192199
}
193200

0 commit comments

Comments
 (0)