-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev' into category-custom/tsc-…
…build
- Loading branch information
Showing
857 changed files
with
39,275 additions
and
22,200 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
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,38 @@ | ||
#!/bin/bash -e | ||
|
||
git config --global user.name aws-amplify-bot | ||
git config --global user.email [email protected] | ||
|
||
if [[ "$PROJECT_NAME" == "TaggedReleaseWithoutE2E" ]]; then | ||
if [ -z "$NPM_TAG" ]; then | ||
echo "Tag name is missing. Make sure CodeBuild workflow was started with NPM_TAG environment variable" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$BRANCH_NAME" == "main" ]] || [[ "$BRANCH_NAME" == "dev" ]] || [[ "$BRANCH_NAME" == "hotfix" ]] || [[ "$BRANCH_NAME" == "release" ]]; then | ||
echo "You can't use $BRANCH_NAME for tagged release" | ||
exit 1 | ||
fi | ||
|
||
npx lerna version --exact --preid=$NPM_TAG --conventional-commits --conventional-prerelease --yes --no-push --include-merged-tags --message "chore(release): Publish tagged release $NPM_TAG" --no-commit-hooks --force-publish '@aws-amplify/cli-internal' | ||
|
||
# @latest release | ||
elif [[ "$PROJECT_NAME" == "Release" ]]; then | ||
|
||
if [[ "$BRANCH_NAME" != "release" ]]; then | ||
echo "Release must run from release branch. Branch provided was $BRANCH_NAME." | ||
exit 1 | ||
fi | ||
|
||
# create release commit and release tags | ||
npx lerna version --exact --conventional-commits --conventional-graduate --yes --no-push --include-merged-tags --message "chore(release): Publish latest" --no-commit-hooks --force-publish '@aws-amplify/cli-internal' | ||
|
||
# release candidate | ||
elif [[ "$PROJECT_NAME" == "RC" ]]; then | ||
# create release commit and release tags | ||
npx lerna version --preid=rc.$(git rev-parse --short=15 HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish rc" --no-commit-hooks --force-publish '@aws-amplify/cli-internal' | ||
# local publish for testing / building binary, dev branch build, e2e tests | ||
else | ||
# create release commit and release tags | ||
npx lerna version --preid=dev.$(git rev-parse HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish dev" --no-commit-hooks --force-publish '@aws-amplify/cli-internal' | ||
fi |
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,40 @@ | ||
#!/bin/bash -e | ||
|
||
git config --global user.name aws-amplify-bot | ||
git config --global user.email [email protected] | ||
|
||
if [[ "$BRANCH_NAME" == "" ]]; then | ||
echo "BRANCH_NAME must be defined for push to git step." | ||
exit 1 | ||
fi | ||
|
||
if [[ "$PROJECT_NAME" == "TaggedReleaseWithoutE2E" ]] || [[ "$PROJECT_NAME" == "RC" ]]; then | ||
# push release commit | ||
git push origin "$BRANCH_NAME" --no-verify | ||
|
||
# push release tags | ||
git tag --points-at HEAD | xargs git push origin --no-verify | ||
|
||
# @latest release | ||
elif [[ "$PROJECT_NAME" == "Release" ]]; then | ||
# push release commit | ||
git push origin "$BRANCH_NAME" --no-verify | ||
|
||
# push release tags | ||
git tag --points-at HEAD | xargs git push origin --no-verify | ||
|
||
# fast forward main to release | ||
git fetch origin main | ||
git checkout main | ||
git merge release --ff-only | ||
git push origin main --no-verify | ||
|
||
# fast forward hotfix to release | ||
git fetch origin hotfix | ||
git checkout hotfix | ||
git merge release --ff-only | ||
git push origin hotfix --no-verify | ||
else | ||
echo "Project name" "$PROJECT_NAME" "did not match any publish rules." | ||
exit 1 | ||
fi |
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,45 @@ | ||
#!/bin/bash -e | ||
|
||
# This script checks out a branch & loads git tags. | ||
|
||
# Get the hash that CodeBuild used to start workflow and use it later to validate that we didn't change it after transformations below. | ||
INITIAL_HEAD_HASH=$(git rev-parse HEAD) | ||
|
||
git status | ||
|
||
echo "PROJECT_NAME=$PROJECT_NAME" | ||
echo "CODEBUILD_SOURCE_VERSION=$CODEBUILD_SOURCE_VERSION" | ||
echo "BRANCH_NAME=$BRANCH_NAME" | ||
echo "CODEBUILD_WEBHOOK_TRIGGER=$CODEBUILD_WEBHOOK_TRIGGER" | ||
|
||
# Codebuild doesn't checkout the branch by default | ||
if [[ "$PROJECT_NAME" == "AmplifyCLI-PR-Testing" ]]; then | ||
# If we're in PR workflow create temporary local branch. | ||
echo "Creating temporary local branch for PR build" | ||
TEMP_BRANCH_NAME=$(cat /proc/sys/kernel/random/uuid) | ||
git checkout -b $TEMP_BRANCH_NAME | ||
elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" == "branch/dev" ]]; then | ||
# We're in E2E workflow triggered after pushing to dev. | ||
echo "Checking out dev" | ||
git checkout dev | ||
elif [[ "$BRANCH_NAME" == "" ]]; then | ||
echo "BRANCH_NAME must be defined for non-PR builds" | ||
exit 1 | ||
else | ||
echo "Checking out $BRANCH_NAME" | ||
git checkout $BRANCH_NAME | ||
fi | ||
|
||
git show --summary | ||
|
||
echo "Fetching tags" | ||
git fetch --all --tags | ||
|
||
# A sanity check that we haven't altered commit we're building from. This must be last section in this script | ||
HEAD_HASH=$(git rev-parse HEAD) | ||
if [[ "$INITIAL_HEAD_HASH" != "$HEAD_HASH" ]]; then | ||
echo "Fail! Detected a drift of commit we attempt to build!" | ||
echo "INITIAL_HEAD_HASH=$INITIAL_HEAD_HASH" | ||
echo "HEAD_HASH=$HEAD_HASH" | ||
exit 1 | ||
fi |
Oops, something went wrong.