Skip to content

Commit

Permalink
Separate client/runtime release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Sep 5, 2024
1 parent f5c99e9 commit 6a9a9f2
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 216 deletions.
155 changes: 91 additions & 64 deletions .github/scripts/generate-release-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,13 @@ async function main() {
describe: "Repository name (Ex: Astar)",
required: true,
},
type: {
type: "string",
describe: "Type of release - runtime or client",
choices: ["runtime", "client"],
required: true,
}
})
.demandOption(["from", "to"])
.help().argv;

const octokit = new Octokit({
Expand All @@ -264,10 +269,6 @@ async function main() {
const previousTag = argv.from;
const newTag = argv.to;

const runtimes = ["shibuya", "shiden", "astar"].map((runtimeName) =>
getRuntimeInfo(argv["srtool-report-folder"], runtimeName)
);

const moduleLinks = ["polkadot-sdk", "frontier"].map((repoName) => ({
name: repoName,
link: getCompareLink(repoName, previousTag, newTag),
Expand Down Expand Up @@ -297,65 +298,91 @@ async function main() {
}
};

const template = `
## Description
(Placeholder for release descriptions, please freely write explanations for this release here.)
\*\*Upgrade priority: LOW/MID/HIGH/CRITICAL\*\*
> DELETE THIS
> CRITICAL - contains critical update for the client which should be rolled out ASAP
> HIGH - significant changes to client
> MEDIUM - some minor changes to the client
> LOW - no client changes
${runtimes.length > 0 ? `## Runtimes
${runtimes
.map(
(runtime) => `### ${capitalize(runtime.name)}
\`\`\`
✨ spec_version: ${runtime.version}
🏋 Runtime Size: ${runtime.srtool.runtimes.compressed.size}
🗜 Compressed: ${runtime.srtool.runtimes.compressed.subwasm.compression.compressed ? "Yes" : "No"}
🎁 Metadata version: ${runtime.srtool.runtimes.compressed.subwasm.metadata_version}
🗳️ sha256: ${runtime.srtool.runtimes.compressed.sha256}
🗳️ blake2-256: ${runtime.srtool.runtimes.compressed.blake2_256}
🗳️ proposal (authorizeUpgrade): ${runtime.srtool.runtimes.compressed.subwasm.parachain_authorize_upgrade_hash}
📦 IPFS: ${runtime.srtool.runtimes.compressed.subwasm.ipfs_hash}
\`\`\`
`).join(`\n`)}` : ""}
## Build Info
WASM runtime built using \`${runtimes[0]?.srtool.info.rustc}\`
## Changes
### Client
${clientPRs.length > 0 ? `
${clientPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
### Runtime
${runtimePRs.length > 0 ? `
${runtimePRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
### Others
${remainingPRs.length > 0 ? `
${remainingPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
## Dependency Changes
Astar: https://github.com/${argv.owner}/${argv.repo}/compare/${previousTag}...${newTag}
${moduleLinks.map((modules) => `${capitalize(modules.name)}: ${modules.link}`).join("\n")}
## Download Links
| Arch | Link |
| ----------- | ------- |
| \`MacOS x86_64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-macOS-x86_64.tar.gz) |
| \`Ubuntu x86_64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-ubuntu-x86_64.tar.gz) |
| \`Ubuntu aarch64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-ubuntu-aarch64.tar.gz) |
[<img src="https://github.com/AstarNetwork/Astar/blob/master/.github/images/docker.webp" height="200px">](https://hub.docker.com/r/staketechnologies/astar-collator/tags)
`

console.log(template);
if (argv.type === "client") {
const template = `
## Description
(Placeholder for release descriptions, please freely write explanations for this release here.)
\*\*Upgrade priority: LOW/MID/HIGH/CRITICAL\*\*
> DELETE THIS
> CRITICAL - contains critical update for the client which should be rolled out ASAP
> HIGH - significant changes to client
> MEDIUM - some minor changes to the client
> LOW - no client changes
## Changes
### Client
${clientPRs.length > 0 ? `
${clientPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
### Runtime (impacts built-in runtimes)
${runtimePRs.length > 0 ? `
${runtimePRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
### Others
${remainingPRs.length > 0 ? `
${remainingPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
## Dependency Changes
Astar: https://github.com/${argv.owner}/${argv.repo}/compare/${previousTag}...${newTag}
${moduleLinks.map((modules) => `${capitalize(modules.name)}: ${modules.link}`).join("\n")}
## Download Links
| Arch | Link |
| ----------- | ------- |
| \`MacOS x86_64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-macOS-x86_64.tar.gz) |
| \`Ubuntu x86_64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-ubuntu-x86_64.tar.gz) |
| \`Ubuntu aarch64\` | [Download](https://github.com/AstarNetwork/Astar/releases/download/${newTag}/astar-collator-${newTag}-ubuntu-aarch64.tar.gz) |
[<img src="https://github.com/AstarNetwork/Astar/blob/master/.github/images/docker.webp" height="200px">](https://hub.docker.com/r/staketechnologies/astar-collator/tags)
`
console.log(template);
} else if (argv.type === "runtime") {
const runtimes = ["shibuya", "shiden", "astar"].map((runtimeName) =>
getRuntimeInfo(argv["srtool-report-folder"], runtimeName)
);

const template = `
## Description
(Placeholder for release descriptions, please freely write explanations for this release here.)
${runtimes.length > 0 ? `## Runtimes
${runtimes
.map(
(runtime) => `### ${capitalize(runtime.name)}
\`\`\`
✨ spec_version: ${runtime.version}
🏋 Runtime Size: ${runtime.srtool.runtimes.compressed.size}
🗜 Compressed: ${runtime.srtool.runtimes.compressed.subwasm.compression.compressed ? "Yes" : "No"}
🎁 Metadata version: ${runtime.srtool.runtimes.compressed.subwasm.metadata_version}
🗳️ sha256: ${runtime.srtool.runtimes.compressed.sha256}
🗳️ blake2-256: ${runtime.srtool.runtimes.compressed.blake2_256}
📦 IPFS: ${runtime.srtool.runtimes.compressed.subwasm.ipfs_hash}
\`\`\`
`).join(`\n`)}` : ""}
## Build Info
WASM runtime built using \`${runtimes[0]?.srtool.info.rustc}\`
## Changes
### Runtime
${runtimePRs.length > 0 ? `
${runtimePRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
### Others
${remainingPRs.length > 0 ? `
${remainingPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
` : "None"}
## Dependency Changes
Astar: https://github.com/${argv.owner}/${argv.repo}/compare/${previousTag}...${newTag}
${moduleLinks.map((modules) => `${capitalize(modules.name)}: ${modules.link}`).join("\n")}
`
console.log(template);
} else {
console.log("Invalid type - should not happen.");
}
}

main();
Loading

0 comments on commit 6a9a9f2

Please sign in to comment.