-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
269 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name-template: "v$RESOLVED_VERSION" | ||
tag-template: "v$RESOLVED_VERSION" | ||
change-template: "* $TITLE ([#$NUMBER]($URL)). Contributed by @$AUTHOR." | ||
categories: | ||
- title: "🚨 BREAKING CHANGES" | ||
label: "X-Breaking-Change" | ||
- title: "🦖 Deprecations" | ||
label: "T-Deprecation" | ||
- title: "✨ Features" | ||
label: "T-Enhancement" | ||
- title: "🐛 Bug Fixes" | ||
label: "T-Defect" | ||
- title: "🧰 Maintenance" | ||
label: "Dependencies" | ||
collapse-after: 5 | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- "X-Breaking-Change" | ||
default: minor | ||
template: | | ||
$CHANGES | ||
prerelease: true | ||
prerelease-identifier: rc | ||
include-pre-releases: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Release Drafter | ||
on: | ||
push: | ||
branches: [staging] | ||
concurrency: ${{ github.workflow }} | ||
jobs: | ||
draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@dabcf3767562210392d862070ed2ef6434b9bc6f # v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
disable-autolabeler: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Gitflow merge-back master->develop | ||
name: Merge master -> develop | ||
on: | ||
push: | ||
branches: [master] | ||
concurrency: ${{ github.workflow }} | ||
jobs: | ||
merge: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: "yarn" | ||
|
||
- name: Install Deps | ||
run: "yarn install --frozen-lockfile" | ||
|
||
- name: Set up git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "RiotRobot" | ||
- name: Merge to develop | ||
run: | | ||
git checkout develop | ||
git merge -X ours master | ||
- name: Update package.json fields | ||
run: | | ||
# When merging to develop, we need revert the `main` and `typings` fields if we adjusted them previously. | ||
for i in main typings browser | ||
do | ||
# If a `lib` prefixed value is present, it means we adjusted the field | ||
# earlier at publish time, so we should revert it now. | ||
if [ "$(jq -r ".matrix_lib_$i" package.json)" != "null" ]; then | ||
# If there's a `src` prefixed value, use that, otherwise delete. | ||
# This is used to delete the `typings` field and reset `main` back to the TypeScript source. | ||
src_value=$(jq -r ".matrix_src_$i" package.json) | ||
if [ "$src_value" != "null" ]; then | ||
jq ".$i = .matrix_src_$i" package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json | ||
else | ||
jq "del(.$i)" package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json | ||
fi | ||
fi | ||
done | ||
- name: Commit and push changes | ||
run: | | ||
git add package.json | ||
git commit -m "Resetting package fields for development" | ||
git push origin develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,148 @@ | ||
name: Release Process | ||
on: | ||
release: | ||
types: [published] | ||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
workflow_dispatch: | ||
inputs: | ||
mode: | ||
description: What type of release | ||
required: true | ||
default: rc | ||
type: choice | ||
options: | ||
- rc | ||
- final | ||
docs: | ||
description: Publish docs | ||
required: true | ||
type: boolean | ||
default: true | ||
npm: | ||
description: Publish to npm | ||
required: true | ||
type: boolean | ||
default: true | ||
concurrency: ${{ github.workflow }} | ||
jobs: | ||
jsdoc: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get draft release | ||
id: release | ||
uses: cardinalby/git-get-release-action@cedef2faf69cb7c55b285bad07688d04430b7ada # v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
draft: true | ||
latest: true | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
ref: staging | ||
token: ${{ secrets.ELEMENT_BOT_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: "yarn" | ||
|
||
- name: Install Deps | ||
run: "yarn install --frozen-lockfile" | ||
|
||
- name: Load version | ||
run: echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
env: | ||
VERSION: ${{ steps.release.outputs.tag_name }} | ||
|
||
- name: Finalise version | ||
if: inputs.mode == 'final' | ||
run: echo "VERSION=$(echo $VERSION | cut -d- -f1)" >> $GITHUB_ENV | ||
|
||
- name: Bump package.json version | ||
run: yarn version --no-git-tag-version --new-version "$VERSION" | ||
|
||
- name: Add to CHANGELOG.md | ||
if: inputs.mode == 'final' | ||
run: | | ||
mv CHANGELOG.md CHANGELOG.md.old | ||
HEADER="Changes in [${VERSION#v}](https://github.com/${{ github.repository }}/releases/tag/$VERSION) ($(date '+%Y-%m-%d'))" | ||
{ | ||
echo "$HEADER" | ||
printf '=%.0s' $(seq ${#HEADER}) | ||
echo "" | ||
echo "$BODY" | ||
echo "" | ||
} > CHANGELOG.md | ||
cat CHANGELOG.md.old >> CHANGELOG.md | ||
rm CHANGELOG.md.old | ||
env: | ||
BODY: ${{ steps.release.outputs.body }} | ||
|
||
# For the published and dist versions of the package, | ||
# we copy the `matrix_lib_main` and `matrix_lib_typings` fields to `main` and `typings` (if they exist). | ||
# This small bit of gymnastics allows us to use the TypeScript source directly for development without | ||
# needing to build before linting or testing. | ||
- name: Update package.json fields | ||
run: | | ||
for i in main typings browser | ||
do | ||
lib_value=$(jq -r ".matrix_lib_$i" package.json) | ||
if [ "$lib_value" != "null" ]; then | ||
jq ".$i = .matrix_lib_$i" package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json | ||
fi | ||
done | ||
- name: Set up git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "RiotRobot" | ||
- name: Commit and push changes | ||
run: | | ||
git add package.json CHANGELOG.md | ||
git commit -m "$VERSION" | ||
git push origin staging | ||
- name: Merge to master | ||
if: inputs.mode == 'final' | ||
run: | | ||
git checkout master | ||
git merge -X theirs staging | ||
git push origin master | ||
- name: Publish release | ||
uses: actions/github-script@v6 | ||
id: my-script | ||
env: | ||
RELEASE_ID: ${{ steps.release.outputs.id }} | ||
MODE: ${{ inputs.mode }} | ||
with: | ||
result-encoding: string | ||
retries: 3 | ||
script: | | ||
let { RELEASE_ID: release_id, VERSION, MODE } = process.env; | ||
const { owner, repo } = context.repo; | ||
const opts = { | ||
owner, | ||
repo, | ||
release_id, | ||
tag_name: VERSION, | ||
name: VERSION, | ||
draft: false, | ||
}; | ||
if (MODE === "final") { | ||
opts.prerelease = false; | ||
opts.make_latest = true; | ||
} | ||
github.rest.repos.updateRelease(opts); | ||
docs: | ||
name: Publish Documentation | ||
needs: release | ||
if: inputs.docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🧮 Checkout code | ||
|
@@ -36,17 +173,22 @@ jobs: | |
yarn gendoc | ||
symlinks -rc _docs | ||
- name: 🚀 Deploy | ||
- name: 🔨 Set up git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "RiotRobot" | ||
- name: 🚀 Deploy | ||
run: | | ||
git add . --all | ||
git commit -m "Update docs" | ||
git push | ||
working-directory: _docs | ||
|
||
npm: | ||
name: Publish | ||
needs: release | ||
if: inputs.npm | ||
uses: matrix-org/matrix-js-sdk/.github/workflows/release-npm.yml@develop | ||
secrets: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Release Process | ||
|
||
## Hotfix and off-cycle releases | ||
|
||
1. Prepare the `staging` branch by using the backport automation and manually merging | ||
2. Go to [Releasing](#Releasing) | ||
|
||
## Release candidates | ||
|
||
1. Prepare the `staging` branch by running the [branch cut automation](https://github.com/vector-im/element-web/actions/workflows/release_prepare.yml) | ||
2. Go to [Releasing](#Releasing) | ||
|
||
## Releasing | ||
|
||
1. Open the [Releases page](https://github.com/matrix-org/matrix-js-sdk/releases) and inspect the draft release there | ||
2. Make any modifications to the release notes and tag/version as required | ||
3. Run [workflow](https://github.com/matrix-org/matrix-js-sdk/actions/workflows/release.yml) with the type set appropriately | ||
|
||
## Artifacts | ||
|
||
Releasing the Matrix JS SDK has just two artifacts: | ||
|
||
- Package published to [npm](https://github.com/matrix-org/matrix-js-sdk) | ||
- Docs published to [Github Pages](https://matrix-org.github.io/matrix-js-sdk/) |