Skip to content

Commit

Permalink
.minisig instead of .minisign
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Jun 6, 2024
1 parent 8ae3ebd commit 7dd5efe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ All other fields are interpreted as release artifacts. The key must have the fol

Artifacts that target windows must be `.zip` files. All other non windows targets must include `.tar.xz` **and** `.tar.gz`.

Release artifacts can also be signed with [minisign](https://jedisct1.github.io/minisign/) by publishing an additional `.minisign` file for every artifact. (Example: `zls-linux-x86_64-0.1.0.tar.xz.minisign`)
Release artifacts can also be signed with [minisign](https://jedisct1.github.io/minisign/) by publishing an additional `.minisig` file for every artifact. (Example: `zls-linux-x86_64-0.1.0.tar.xz.minisig`)

## Development

Expand Down
6 changes: 3 additions & 3 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export async function handlePublish(
});
}

if (key.endsWith(".minisign")) {
if (key.endsWith(".minisig")) {
assert(!(key in artifactMinisigns)); // keys are unique
artifactMinisigns[key] = file;
continue;
Expand Down Expand Up @@ -364,7 +364,7 @@ export async function handlePublish(

for (const minisignFileName of Object.keys(artifactMinisigns)) {
const artifactIndex = artifactFiles.findIndex(
(file) => `${file.name}.minisign` == minisignFileName,
(file) => `${file.name}.minisig` == minisignFileName,
);
if (artifactIndex === -1) {
return new Response(
Expand Down Expand Up @@ -535,7 +535,7 @@ export async function handlePublish(
for (let i = 0; i < artifacts.length; i++) {
const artifact = artifacts[i];
const file = artifactFiles[i];
const minisignFile = artifactMinisigns[`${file.name}.minisign`];
const minisignFile = artifactMinisigns[`${file.name}.minisig`];

promises.push(
env.ZIGTOOLS_BUILDS.put(file.name, file, {
Expand Down
14 changes: 7 additions & 7 deletions test/publish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function sendPublish({
assert(!form.has(fileName));
form.set(fileName, file, fileName);
if (withMinisign ?? false) {
const minisignFileName = `${fileName}.minisign`;
const minisignFileName = `${fileName}.minisig`;
assert(!form.has(minisignFileName));
form.set(
minisignFileName,
Expand Down Expand Up @@ -901,14 +901,14 @@ describe("/v1/publish", () => {
size: gzipMagicNumber.length + 7,
},
{
key: "zls-linux-x86_64-0.1.0.tar.gz.minisign",
key: "zls-linux-x86_64-0.1.0.tar.gz.minisig",
},
{
key: "zls-linux-x86_64-0.1.0.tar.xz",
size: xzMagicNumber.length + 7,
},
{
key: "zls-linux-x86_64-0.1.0.tar.xz.minisign",
key: "zls-linux-x86_64-0.1.0.tar.xz.minisig",
},
]);
});
Expand Down Expand Up @@ -948,12 +948,12 @@ describe("/v1/publish", () => {
"zls-linux-x86_64-0.11.0.tar.xz",
new Blob([xzMagicNumber, "binary1"]),
],
["zls-linux-x86_64-0.11.0.tar.xz.minisign", new Blob(["something"])],
["zls-linux-x86_64-0.11.0.tar.xz.minisig", new Blob(["something"])],
[
"zls-linux-x86_64-0.11.0.tar.gz",
new Blob([gzipMagicNumber, "binary1"]),
],
["zls-linux-x86_64-0.11.0.tar.gz.minisign", new Blob(["something"])],
["zls-linux-x86_64-0.11.0.tar.gz.minisig", new Blob(["something"])],
[
"zls-windows-aarch64-0.11.0.zip",
new Blob([zipMagicNumber, "binary2"]),
Expand All @@ -972,12 +972,12 @@ describe("/v1/publish", () => {
zlsVersion: "0.1.0",
zigVersion: "0.1.0",
artifacts: [
["zls-linux-x86_64-0.11.0.tar.xz.minisign", new Blob(["something"])],
["zls-linux-x86_64-0.11.0.tar.xz.minisig", new Blob(["something"])],
],
});

expect(await response.text()).toBe(
"minisign file 'zls-linux-x86_64-0.11.0.tar.xz.minisign' has not matching artifact!",
"minisign file 'zls-linux-x86_64-0.11.0.tar.xz.minisig' has not matching artifact!",
);
expect(response.status).toBe(400);
});
Expand Down

0 comments on commit 7dd5efe

Please sign in to comment.