Skip to content

Commit

Permalink
Separate client/runtime release (#1352)
Browse files Browse the repository at this point in the history
* Separate client/runtime release

* Latest release tag

* Comments, cleanup

* Migrate changes

* Newlines

* Review comment

* Fix approach for getting latest runtime tag

* Add lost change

* Add lost change

* Incorrect location

* Apply suggestions from code review

Co-authored-by: Ermal Kaleci <[email protected]>

* Fix

* Remove sccache

* Update readme

* Bump upload/download action version

* Revert "Bump upload/download action version"

This reverts commit 5b968a0.

* Update README.md

Co-authored-by: Ermal Kaleci <[email protected]>

---------

Co-authored-by: Ermal Kaleci <[email protected]>
  • Loading branch information
Dinonard and ermalkaleci authored Sep 11, 2024
1 parent 1f21fe5 commit 817717c
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 293 deletions.
83 changes: 55 additions & 28 deletions .github/scripts/generate-release-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,25 +236,30 @@ async function main() {
from: {
type: "string",
describe: "previous tag to retrieve commits from",
required: true,
requiresArg: true,
},
to: {
type: "string",
describe: "current tag being drafted",
required: true,
requiresArg: true,
},
owner: {
type: "string",
describe: "Repository owner (Ex: AstarNetwork)",
required: true,
requiresArg: true,
},
repo: {
type: "string",
describe: "Repository name (Ex: Astar)",
required: true,
requiresArg: true,
},
type: {
type: "string",
describe: "Type of release - runtime or client",
choices: ["runtime", "client"],
requiresArg: 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,7 +298,8 @@ async function main() {
}
};

const template = `
if (argv.type === "client") {
const template = `
## Description
(Placeholder for release descriptions, please freely write explanations for this release here.)
Expand All @@ -308,6 +310,43 @@ async function main() {
> 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(
Expand All @@ -319,7 +358,6 @@ ${runtimes
🎁 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`)}` : ""}
Expand All @@ -328,10 +366,6 @@ ${runtimes
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")}
Expand All @@ -344,18 +378,11 @@ ${remainingPRs.map((pr) => `* ${printPr(pr)}`).join("\n")}
## 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);
`
console.log(template);
} else {
console.log("Invalid type - should not happen.");
}
}

main();
main();
1 change: 1 addition & 0 deletions .github/workflows/base_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- '**'
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
- runtime-[0-9]+*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
Loading

0 comments on commit 817717c

Please sign in to comment.