Skip to content

Commit

Permalink
Merge pull request #2862 from aws-amplify/add-postpublish-trigger
Browse files Browse the repository at this point in the history
chore: add postpublish trigger
  • Loading branch information
phani-srikar authored Sep 11, 2024
2 parents 915a0c1 + 77b4f63 commit e9a3f2a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Empty file modified codebuild_specs/scripts/post_publish.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions codebuild_specs/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ else
git config --global user.name $GITHUB_USER
fi

if [ "$RUN_POST_PUBLISH_ONLY" = "true" ]; then
echo "Post publish script is invoked on branch $BRANCH_NAME"
yarn postpublish:$BRANCH_NAME
exit 0
fi

RESERVED_TAGS=(alpha beta dev latest main api-plugin-stable)

if [[ "$BRANCH_NAME" =~ ^tagged-release ]]; then
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"test-v2-transformers": "lerna run --scope '@aws-amplify/graphql-*-transformer' test",
"test": "lerna run test",
"trigger-release": "source ./scripts/cloud-release.sh && triggerRelease",
"trigger-postpublish": "source ./scripts/cloud-release.sh && triggerPostPublish",
"trigger-tag-release": "source ./scripts/cloud-release.sh && triggerTagRelease",
"trigger-deprecate-release": "source ./scripts/cloud-release.sh && deprecateRelease",
"update-cli-packages": "./scripts/update-cli-dependencies.sh && yarn",
Expand Down
11 changes: 11 additions & 0 deletions scripts/cloud-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ function triggerRelease {
fi
}

function triggerPostPublish {
branch_name=$(git branch --show-current)
if isReleaseBranch "$branch_name"; then
echo "Running release workflow from branch ${branch_name}"
triggerProjectBatchWithEnvOverrides $RELEASE_ACCOUNT_PROD $RELEASE_ROLE_NAME "${RELEASE_PROFILE_NAME}Prod" $RELEASE_PROJECT_NAME $branch_name \
name=RUN_POST_PUBLISH_ONLY,value=\""true\"",type=PLAINTEXT
else
echo "The post publish workflow can only be triggered from a release branch."
fi
}

function triggerTagRelease {
branch_name=$(git branch --show-current)
echo "Running tag release workflow from branch ${branch_name}"
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,18 @@
graphql "^15.5.0"
prettier "^1.19.1"

"@aws-amplify/[email protected]":
version "2.11.4"
resolved "https://registry.npmjs.org/@aws-amplify/graphql-model-transformer/-/graphql-model-transformer-2.11.4.tgz#542634be58b138e181eda6f33fbf98d121610a4e"
integrity sha512-RvBLuMxxswbCTd3X6Ko3J4W/YwJnfo7eWUgK+ShgmOvCdwpLedZlh2eScj35v2ScNn0XIfHIEf/8iBgqGdpGiQ==
dependencies:
"@aws-amplify/graphql-directives" "1.1.0"
"@aws-amplify/graphql-transformer-core" "2.9.3"
"@aws-amplify/graphql-transformer-interfaces" "3.10.1"
graphql "^15.5.0"
graphql-mapping-template "4.20.16"
graphql-transformer-common "4.31.1"

"@aws-amplify/graphql-schema-generator@^0.9.4":
version "0.9.4"
resolved "https://registry.npmjs.org/@aws-amplify/graphql-schema-generator/-/graphql-schema-generator-0.9.4.tgz#50b6643af8abe8314067f82616645967b45d14ca"
Expand Down

0 comments on commit e9a3f2a

Please sign in to comment.