From 26b459514c8255d55ac445d24c07c94267268cb9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 Jan 2024 18:24:53 +0000 Subject: [PATCH] Rebuild release automation to provide better introspection 1. Draft releases are triggered by the release person 2. Draft releases are inspected & tested along with their artifacts & notes 3. Draft releases are published when ready and this kicks off any deploys e.g. npm, docs, etc Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .github/workflows/release-drafter.yml | 54 +++++++++++++++++++++------ .github/workflows/release.yml | 37 ++---------------- docs/release.md | 25 +++++++------ 3 files changed, 61 insertions(+), 55 deletions(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 4d889f4561..2af7a58eb9 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,21 +1,53 @@ name: Release Drafter on: - push: - branches: [staging] workflow_dispatch: inputs: + version-bump: + description: The scale of the version bump required for semver compatibility + required: true + default: automatic + type: choice + options: + - automatic + - patch + - minor + - major + type: + description: The type of release to make + required: true + default: release-candidate + type: choice + options: + - release-candidate + - release + - hotfix previous-version: - description: What release to use as a base for release note purposes + description: What release to use as a base for release note purposes, defaults to the latest stable release. required: false type: string + matrix-react-sdk: + description: React SDK version to use (current|X.Y.Z) + required: false + default: current + type: string + matrix-js-sdk: + description: JS SDK version to use (current|X.Y.Z) + required: false + default: current + type: string concurrency: ${{ github.workflow }} jobs: draft: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@e64b19c4c46173209ed9f2e5a2f4ca7de89a0e86 # v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - disable-autolabeler: true - previous-version: ${{ inputs.previous-version }} + uses: matrix-org/matrix-js-sdk/.github/workflows/release-drafter-action.yml@develop + secrets: inherit + with: + version-bump: ${{ inputs.version-bump }} + previous-version: ${{ inputs.previous-version }} + final: ${{ inputs.type != 'release-candidate' }} + include-changes: matrix-react-sdk + gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }} + asset-path: dist/*.tar.gz + expected-asset-count: 3 + dependencies: | + matrix-react-sdk=${{ inputs.matrix-react-sdk }} + matrix-js-sdk=${{ inputs.matrix-js-sdk }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5639629e67..795fb28f6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,39 +1,10 @@ -name: Release Process +name: Post Release Process on: - workflow_dispatch: - inputs: - mode: - description: What type of release - required: true - default: rc - type: choice - options: - - rc - - final - matrix-react-sdk: - description: React SDK version to use (current|X.Y.Z) - required: false - default: current - type: string - matrix-js-sdk: - description: JS SDK version to use (current|X.Y.Z) - required: false - default: current - type: string + release: + types: [published] concurrency: ${{ github.workflow }} jobs: release: - uses: matrix-org/matrix-js-sdk/.github/workflows/release-make.yml@develop + uses: matrix-org/matrix-js-sdk/.github/workflows/release-action.yml@develop secrets: ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - with: - final: ${{ inputs.mode == 'final' }} - include-changes: matrix-react-sdk - gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }} - asset-path: dist/*.tar.gz - expected-asset-count: 3 - dependencies: | - matrix-react-sdk=${{ inputs.matrix-react-sdk }} - matrix-js-sdk=${{ inputs.matrix-js-sdk }} diff --git a/docs/release.md b/docs/release.md index 9dad7bc1bb..82c28a28c0 100644 --- a/docs/release.md +++ b/docs/release.md @@ -192,35 +192,38 @@ _Note: we should add a step here to write summaries atop the changelogs manually ### Matrix JS SDK -The first stop is the matrix-js-sdk; kick off a release using [the automation](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. You should not need to ever switch off either of the Publishing options. +The first stop is the matrix-js-sdk; draft a release using [the automation](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release-drafter.yml) - making sure to select the right type of release. -- [ ] matrix-js-sdk has been released & published to npm +- [ ] Check the release notes & artifacts for the draft release, publish when ready +- [ ] Check that matrix-js-sdk has been published to npm +- [ ] Check that the docs have published successfully ### Matrix React SDK -The next stop is matrix-react-sdk; kick off a release using [the automation](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the JS SDK version field enter the version of the JS SDK you wish to use, for typical releases including all the layers this would be the version released in the stage above. +The next stop is matrix-react-sdk; draft a release using [the automation](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/release-drafter.yml) - making sure to select the right type of release. In the JS SDK version field enter the version of the JS SDK you wish to use, for typical releases including all the layers this would be the version released in the stage above. -- [ ] matrix-react-sdk has been released & published to npm +- [ ] Check the release notes & artifacts for the draft release, publish when ready +- [ ] Check that matrix-react-sdk has been published to npm ### Element Web -The next stop is element-web; kick off a release using [the automation](https://github.com/element-hq/element-web/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the SDK version fields enter the versions you wish to use, for typical releases including all the layers this would be the versions released in the stages above. +The next stop is element-web; draft a release using [the automation](https://github.com/element-hq/element-web/actions/workflows/release-drafter.yml) - making sure to select the right type of release. In the SDK version fields enter the versions you wish to use, for typical releases including all the layers this would be the versions released in the stages above. -- [ ] Element Web has been released +- [ ] Check the release notes & artifacts for the draft release, publish when ready ### Element Desktop -The next stop is element-desktop; kick off a release using [the automation](https://github.com/element-hq/element-desktop/actions/workflows/release.yml) - making sure to select the right type of release. For anything other than an RC: choose final. In the JS SDK version field enter the version of the JS SDK you wish to use, for typical releases including all the layers this would be the version released in the stage above. +The next stop is element-desktop; draft a release using [the automation](https://github.com/element-hq/element-desktop/actions/workflows/release-drafter.yml) - making sure to select the right type of release. -- [ ] Element Desktop has been released +- [ ] Check the release notes & artifacts for the draft release, publish when ready # Deploying -We ship the SDKs to npm, this happens as part of the release process. +We ship the SDKs to npm, this happens as part of the release process once the draft is published. We ship Element Web to dockerhub, `*.element.io`, and packages.element.io. We ship Element Desktop to packages.element.io. -- [ ] Check that element-web has shipped to dockerhub +- [ ] Check that Element Web has shipped to dockerhub - [ ] Deploy staging.element.io. [See docs.](https://handbook.element.io/books/element-web-team/page/deploying-appstagingelementio) - [ ] Test staging.element.io @@ -228,7 +231,7 @@ For final releases additionally do these steps: - [ ] Deploy app.element.io. [See docs.](https://handbook.element.io/books/element-web-team/page/deploying-appstagingelementio) - [ ] Test app.element.io -- [ ] Ensure Element Web package has shipped to packages.element.io +- [ ] Ensure `element-web` debian package has shipped to packages.element.io - [ ] Ensure Element Desktop packages have shipped to packages.element.io # Housekeeping