diff --git a/.github/workflows/client-release-issue.yml b/.github/workflows/client-release-issue.yml new file mode 100644 index 00000000000..62bb65025be --- /dev/null +++ b/.github/workflows/client-release-issue.yml @@ -0,0 +1,35 @@ +name: Create client release ticket +on: + workflow_dispatch: + inputs: + from: + description: "Previous client version" + required: true + to: + description: "Next client version" + required: true + +jobs: + create_client_ticket: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Generate client release issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd tools + yarn install + yarn --silent run print-client-release-issue --from ${{ github.event.inputs.from }} --to ${{ github.event.inputs.to }} | tee ../client-release-issue.md + - name: Create version bump issue + uses: peter-evans/create-issue-from-file@v3 + with: + title: v${{ github.event.inputs.to }} release + content-filepath: ./client-release-issue.md + labels: | + automated issue diff --git a/tools/github/print-client-release-issue.ts b/tools/github/print-client-release-issue.ts new file mode 100644 index 00000000000..66dbd28956d --- /dev/null +++ b/tools/github/print-client-release-issue.ts @@ -0,0 +1,46 @@ +import yargs from "yargs"; + +async function main() { + const argv = yargs(process.argv.slice(2)) + .usage("Usage: npm run ts-node github/generate-gh-issue-client-release.ts [args]") + .version("1.0.0") + .options({ + from: { + type: "string", + describe: "previous client version", + required: true, + }, + to: { + type: "string", + describe: "next client version", + required: true, + }, + }) + .demandOption(["from", "to"]) + .help().argv; + + const previousVersion = argv.from; + const newVersion = argv.to; + + const template = ` + - [ ] Create a PR with v${newVersion} (see README.md last section or last v${previousVersion} PR + to see the required changed) + - [ ] Get that PR approved and merged + - [ ] Tag master with v${newVersion} and push to github + - [ ] Start the github action Publish Binary Draft with v${previousVersion} => v${newVersion} + (master branch) + - [ ] Review the generated Draft and clean a bit the messages if needed (keep it draft) + - [ ] Update moonbeam-networks stagenet (moonsama/moonlama) config.json to include sha-xxxxx + (matching your v${newVersion} tag) and increase the config version + 1 + - [ ] Test the new client on stagenet (moonsama/moonlama) + - [ ] Publish the client release draft + - [ ] When everything is ok, publish the new docker image: start github action Publish Docker + with v${newVersion} + - [ ] Publish the new tracing image: on repo moonbeam-runtime-overrides, start github action + Publish Docker with v${newVersion} and master + `; + + console.log(template); +} + +main(); diff --git a/tools/package.json b/tools/package.json index 5148c8f357d..7e18ea3bf1c 100644 --- a/tools/package.json +++ b/tools/package.json @@ -27,6 +27,7 @@ "package-moon-key": "node_modules/.bin/tsc moon-key.ts; node_modules/.bin/pkg -t node14 moon-key.js; rm moon-key.js", "launch": "ts-node launch", "list-pr-labels": "ts-node github/list-pr-labels.ts", + "print-client-release-issue": "ts-node github/print-client-release-issue.ts", "print-version-bump-info": "ts-node github/print-version-bump-info.ts" } }