-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hs/timestamp-api
- Loading branch information
Showing
31 changed files
with
1,130 additions
and
738 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 +1 @@ | ||
* turt2live | ||
* @vector-im/bridges |
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
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 @@ | ||
18 |
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
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
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
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,33 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
for REMOTE in $(git remote); do | ||
URL=$(git remote get-url $REMOTE) | ||
if [[ $URL =~ "turt2live" ]]; then | ||
UPSTREAM_REPO=$REMOTE | ||
elif [[ $URL =~ "vector-im" ]]; then | ||
FORK_REPO=$REMOTE | ||
fi | ||
done | ||
|
||
function echoAndDo { | ||
echo "$*" | ||
$* | ||
} | ||
|
||
if [[ -z $UPSTREAM_REPO ]]; then | ||
echo -n 'Adding remote for upstream repo: ' | ||
UPSTREAM_REPO=turt2live | ||
echoAndDo git remote add $UPSTREAM_REPO git@github.com:turt2live/matrix-bot-sdk.git | ||
fi | ||
|
||
if [[ -z $FORK_REPO ]]; then | ||
echo -n 'Adding remote for fork repo: ' | ||
FORK_REPO=vector-im | ||
echoAndDo git remote add $FORK_REPO git@github.com:vector-im/matrix-bot-sdk.git | ||
fi | ||
|
||
for REPO in $UPSTREAM_REPO $FORK_REPO; do | ||
git fetch $REPO >/dev/null | ||
git remote set-head $REPO -a >/dev/null | ||
done |
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 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ $# -lt 1 ]]; then | ||
echo 'Please provide a title for your patch branch' >&2 | ||
exit 1 | ||
fi | ||
PATCH_TITLE=$1 | ||
|
||
. $(dirname $0)/fetch-remotes | ||
|
||
git checkout -b $PATCH_TITLE $(git merge-base $UPSTREAM_REPO $FORK_REPO) | ||
|
||
echo "Branch '$PATCH_TITLE' is now ready. Push changes to this branch when preparing a PR, and aim to merge it to both upstream and the fork." |
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,50 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ -n $(git status --porcelain) ]]; then | ||
echo 'Working dir is dirty, aborting' >&2 | ||
exit 1 | ||
fi | ||
|
||
. $(dirname $0)/fetch-remotes | ||
|
||
git checkout element-release | ||
git reset --hard $FORK_REPO | ||
|
||
PREID=element | ||
|
||
# The latest upstream release tag reachable from the current commit | ||
PREV_UPST_TAG=$(git log --decorate=short --decorate-refs=refs/tags/ --simplify-by-decoration --oneline | awk '/ \(tag: / && !/beta|element/ {sub(/)$/, "", $3); print $3; exit}') | ||
|
||
# The commit hash of the retrieved tag (not of the tag itself) | ||
PREV_UPST_TAG_HASH=$(git rev-parse ${PREV_UPST_TAG}~0) | ||
|
||
# The immediate child commit of the release commit, | ||
# to consider the 'Revert version back to "develop"' commits | ||
PREV_UPST_NXT_HASH=$(git rev-list ${PREV_UPST_TAG}..${UPSTREAM_REPO} | tail -n 1) | ||
|
||
# Check if the current branch is a direct merge of the previous upstream release | ||
for MERGE_PARENT in $(git show -s | awk '/^Merge: / {print $2; print $3; exit}'); do | ||
if [[ $PREV_UPST_TAG_HASH =~ ^$MERGE_PARENT || $PREV_UPST_NXT_HASH =~ ^$MERGE_PARENT ]]; then | ||
RELEASE_MERGE=1 | ||
break | ||
fi | ||
done | ||
|
||
if [[ $RELEASE_MERGE -eq 1 ]]; then | ||
THIS_TAG="${PREV_UPST_TAG}-${PREID}" | ||
THIS_VER=${THIS_TAG#v} | ||
else | ||
THIS_VER=$(npx semver --preid ${PREID} -i prerelease ${PREV_UPST_TAG#v}) | ||
while [[ -n $(git tag -l "v${THIS_VER}") ]]; do | ||
THIS_VER=$(npx semver --preid ${PREID} -i prerelease $THIS_VER) | ||
done | ||
THIS_TAG="v${THIS_VER}" | ||
fi | ||
|
||
sed -i 's/\("version": "\).*\("\)/\1'$THIS_VER'\2/' package.json | ||
git add package.json | ||
git commit -m $THIS_TAG | ||
git tag -sm $THIS_TAG{,} | ||
|
||
echo "Tag '$THIS_TAG' is now ready and may be pushed" |
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
Oops, something went wrong.