diff --git a/buildspec/release/00clonerepo.yml b/buildspec/release/00clonerepo.yml deleted file mode 100644 index 3fbf222ce9a..00000000000 --- a/buildspec/release/00clonerepo.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 0.2 - -env: - variables: - NODE_OPTIONS: '--max-old-space-size=8192' - -phases: - install: - runtime-versions: - nodejs: 16 - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${TOOLKITS_GITHUB_REPO_OWNER}" - - test -n "${TARGET_BRANCH}" - - build: - commands: - - git clone https://github.com/${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode.git aws-toolkit-vscode - # checkout the target branch as we want to commit to it later to update versions - - cd aws-toolkit-vscode && git checkout ${TARGET_BRANCH} - -artifacts: - base-directory: aws-toolkit-vscode - files: - - '**/*' diff --git a/buildspec/release/10changeversion.yml b/buildspec/release/10changeversion.yml deleted file mode 100644 index 2a43a5f515f..00000000000 --- a/buildspec/release/10changeversion.yml +++ /dev/null @@ -1,45 +0,0 @@ -version: 0.2 - -env: - variables: - NODE_OPTIONS: '--max-old-space-size=8192' - -phases: - pre_build: - commands: - - aws codeartifact login --tool npm --domain "$TOOLKITS_CODEARTIFACT_DOMAIN" --domain-owner "$TOOLKITS_ACCOUNT_ID" --repository "$TOOLKITS_CODEARTIFACT_REPO" - - test -n "${TARGET_EXTENSION}" - - install: - runtime-versions: - nodejs: 16 - - build: - commands: - - | - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - echo "Removing SNAPSHOT from version string" - git config --global user.name "aws-toolkit-automation" - git config --global user.email "<>" - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);" | (IFS="-"; read -r version unused && echo "$version")) - DATE=$(date) - npm version --no-git-tag-version "$VERSION" -w packages/${TARGET_EXTENSION} - # 'createRelease' uses ts-node. - # Ignore broken "postinstall" script in "src.gen/@amzn/codewhisperer-streaming/package.json". - npm install --ignore-scripts ts-node - - | - npm run createRelease -w packages/${TARGET_EXTENSION} - - | - git add packages/${TARGET_EXTENSION}/package.json - git add package-lock.json - git commit -m "Release $VERSION" - echo "tagging commit" - # e.g. amazonq/v1.0.0. Ensure this tag is up to date with 50githubrelease.yml - git tag -a "${TARGET_EXTENSION}/v${VERSION}" -m "${TARGET_EXTENSION} version $VERSION $DATE" - # cleanup - git clean -fxd - git reset HEAD --hard - -artifacts: - files: - - '**/*' diff --git a/buildspec/release/20buildrelease.yml b/buildspec/release/20buildrelease.yml deleted file mode 100644 index 8af4ef5df4f..00000000000 --- a/buildspec/release/20buildrelease.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 0.2 - -env: - variables: - NODE_OPTIONS: '--max-old-space-size=8192' - -phases: - pre_build: - commands: - - aws codeartifact login --tool npm --domain "$TOOLKITS_CODEARTIFACT_DOMAIN" --domain-owner "$TOOLKITS_ACCOUNT_ID" --repository "$TOOLKITS_CODEARTIFACT_REPO" - - test -n "${TARGET_EXTENSION}" - install: - runtime-versions: - nodejs: 16 - - commands: - - apt-get update - - apt-get install -y libgtk-3-dev libxss1 xvfb - - apt-get install -y libnss3-dev libasound2 - - apt-get install -y libasound2-plugins - build: - commands: - - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - # --unsafe-perm is needed because we run as root - - npm ci --unsafe-perm - - npm run package -w packages/${TARGET_EXTENSION} - - cp packages/${TARGET_EXTENSION}/package.json ./package.json - - NUM_VSIX=$(ls -1q *.vsix | wc -l) - - | - if [ "$NUM_VSIX" != "1" ]; then - echo "Number of .vsix to release is not exactly 1, it is: ${NUM_VSIX}" - exit 1 - fi - -artifacts: - files: - - '*.vsix' - - package.json diff --git a/buildspec/release/30closegate.yml b/buildspec/release/30closegate.yml deleted file mode 100644 index 618613e782f..00000000000 --- a/buildspec/release/30closegate.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 16 - - pre_build: - commands: - - STAGE_NAME=Release - - PIPELINE=$(echo $CODEBUILD_INITIATOR | sed -e 's/codepipeline\///') - build: - commands: - - | - aws codepipeline disable-stage-transition \ - --pipeline-name "$PIPELINE" \ - --stage-name "$STAGE_NAME" \ - --transition-type "Inbound" \ - --reason "Disabled by CloseGate (automation)" diff --git a/buildspec/release/35opengate.yml b/buildspec/release/35opengate.yml deleted file mode 100644 index 45362ac14e3..00000000000 --- a/buildspec/release/35opengate.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 16 - - pre_build: - commands: - - STAGE_NAME=SourceWithGit - - PIPELINE=$(echo $CODEBUILD_INITIATOR | sed -e 's/codepipeline\///') - build: - commands: - - | - aws codepipeline enable-stage-transition \ - --pipeline-name "$PIPELINE" \ - --stage-name "$STAGE_NAME" \ - --transition-type "Inbound" diff --git a/buildspec/release/40pushtogithub.yml b/buildspec/release/40pushtogithub.yml deleted file mode 100644 index a31f34031a3..00000000000 --- a/buildspec/release/40pushtogithub.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 0.2 - -env: - variables: - NODE_OPTIONS: '--max-old-space-size=8192' - -phases: - install: - runtime-versions: - nodejs: 16 - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${TOOLKITS_GITHUB_REPO_OWNER}" - - test -n "${GITHUB_TOKEN}" - - test -n "${TARGET_EXTENSION}" - - test -n "${TARGET_BRANCH}" - - REPO_URL="https://$GITHUB_TOKEN@github.com/${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode.git" - - build: - commands: - - | - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - git config --global user.name "aws-toolkit-automation" - git config --global user.email "<>" - git remote add originWithCreds "$REPO_URL" - echo "Adding SNAPSHOT to next version string" - # Increase minor version - npm version --no-git-tag-version minor -w packages/${TARGET_EXTENSION} - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);") - # Append -SNAPSHOT - npm version --no-git-tag-version "${VERSION}-SNAPSHOT" -w packages/${TARGET_EXTENSION} - git add packages/${TARGET_EXTENSION}/package.json - git add package-lock.json - git commit -m "Update version to snapshot version: ${VERSION}-SNAPSHOT" - - | - if [ "$STAGE" != "prod" ]; then - echo "SKIPPED (stage=${STAGE}): 'git push originWithCreds ${TARGET_BRANCH}'" - exit 0 - fi - echo "pushing to github" - git fetch originWithCreds ${TARGET_BRANCH} - git merge --no-edit -m "Merge release into ${TARGET_BRANCH}" FETCH_HEAD - git push originWithCreds --tags - git push originWithCreds ${TARGET_BRANCH} diff --git a/buildspec/release/50githubrelease.yml b/buildspec/release/50githubrelease.yml deleted file mode 100644 index df542cbee14..00000000000 --- a/buildspec/release/50githubrelease.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 16 - - Commands: - # GitHub recently changed their GPG signing key for their CLI tool - # These are the updated installation instructions: - # https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt - - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - - chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg - - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null - - apt update - - apt install gh -y - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${TOOLKITS_GITHUB_REPO_OWNER}" - - test -n "${TARGET_EXTENSION}" - - REPO="${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode" - - build: - commands: - - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - # pull in the build artifacts - - cp -r ${CODEBUILD_SRC_DIR_buildPipeline}/* . - - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);") - - UPLOAD_TARGET=$(ls *.vsix) - - HASH_UPLOAD_TARGET=${UPLOAD_TARGET}.sha384 - - 'HASH=$(sha384sum -b $UPLOAD_TARGET | cut -d" " -f1)' - - echo "Writing hash to $HASH_UPLOAD_TARGET" - - echo $HASH > $HASH_UPLOAD_TARGET - - echo "posting $VERSION with sha384 hash $HASH to GitHub" - - PKG_DISPLAY_NAME=$(grep -m 1 displayName packages/${TARGET_EXTENSION}/package.json | grep -o '[a-zA-z][^\"]\+' | tail -n1) - - RELEASE_MESSAGE="${PKG_DISPLAY_NAME} for VS Code $VERSION" - # Only set amazonq as "latest" release. This ensures https://api.github.com/repos/aws/aws-toolkit-vscode/releases/latest - # consistently points to the amazonq artifact, instead of being "random". - - LATEST="$([ "$TARGET_EXTENSION" = amazonq ] && echo '--latest' || echo '--latest=false' )" - - | - if [ "$STAGE" = "prod" ]; then - # note: the tag arg passed here should match what is in 10changeversion.yml - gh release create "$LATEST" --repo $REPO --title "$PKG_DISPLAY_NAME $VERSION" --notes "$RELEASE_MESSAGE" -- "${TARGET_EXTENSION}/v${VERSION}" "$UPLOAD_TARGET" "$HASH_UPLOAD_TARGET" - else - echo "SKIPPED (stage=${STAGE}): 'gh release create --repo $REPO'" - fi diff --git a/buildspec/release/60publish.yml b/buildspec/release/60publish.yml deleted file mode 100644 index 0141b6e68c2..00000000000 --- a/buildspec/release/60publish.yml +++ /dev/null @@ -1,41 +0,0 @@ -# -# Publishes the release vsix to the marketplace. -# - -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 20 - commands: - - apt-get update - - apt-get install -y libsecret-1-dev - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${VS_MARKETPLACE_PAT}" - - test -n "${TARGET_EXTENSION}" - - build: - commands: - - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - # pull in the build artifacts - - cp -r ${CODEBUILD_SRC_DIR_buildPipeline}/* . - - | - UPLOAD_TARGET=$(ls *.vsix) - - | - echo "Publishing to vscode marketplace: $UPLOAD_TARGET" - if [ "$STAGE" != "prod" ]; then - echo "SKIPPED (stage=${STAGE}): 'npx vsce publish --pat xxx --packagePath ${UPLOAD_TARGET}'" - else - npx vsce publish --pat "$VS_MARKETPLACE_PAT" --packagePath "$UPLOAD_TARGET" - fi - - | - echo "Publishing to openvsx marketplace: $UPLOAD_TARGET" - if [ "$STAGE" != "prod" ]; then - echo "SKIPPED (stage=${STAGE}): 'npx --yes ovsx publish --pat xxx "${UPLOAD_TARGET}"'" - else - npx --yes ovsx publish --pat "$OVSX_PAT" "$UPLOAD_TARGET" - fi diff --git a/buildspec/release/70checkmarketplace.yml b/buildspec/release/70checkmarketplace.yml deleted file mode 100644 index 670dd2c7508..00000000000 --- a/buildspec/release/70checkmarketplace.yml +++ /dev/null @@ -1,53 +0,0 @@ -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 16 - - commands: - - apt update - - apt install -y wget gpg - - curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg - - install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ - - sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' - - apt update - - apt install -y code - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${TARGET_EXTENSION}" - - build: - commands: - - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);") - # get extension name, if in beta, use some hard-coded recent version - - | - if [ "${TARGET_EXTENSION}" = "amazonq" ]; then - extension_name="amazonwebservices.amazon-q-vscode" - [ "$STAGE" != "prod" ] && VERSION="1.43.0" || true - elif [ "${TARGET_EXTENSION}" = "toolkit" ]; then - extension_name="amazonwebservices.aws-toolkit-vscode" - [ "$STAGE" != "prod" ] && VERSION="3.42.0" || true - else - echo checkmarketplace: "Unknown TARGET_EXTENSION: ${TARGET_EXTENSION}" - exit 1 - fi - if [ "$STAGE" != "prod" ]; then - echo "checkmarketplace: Non-production stage detected. Installing hardcoded version '${VERSION}'." - fi - # keep installing the desired extension version until successful. Otherwise fail on codebuild timeout (1 hour). - - | - while true; do - code --uninstall-extension "${extension_name}" --no-sandbox --user-data-dir /tmp/vscode - code --install-extension "${extension_name}@${VERSION}" --no-sandbox --user-data-dir /tmp/vscode || true - cur_version=$(code --list-extensions --show-versions --no-sandbox --user-data-dir /tmp/vscode | grep ${extension_name} | cut -d'@' -f2) - if [ "${cur_version}" = "${VERSION}" ]; then - echo "checkmarketplace: Extension ${extension_name} is updated to version '${cur_version}.'" - break - else - echo "checkmarketplace: Expected extension version '${VERSION}' has not been successfully installed. Retrying..." - fi - sleep 120 # Wait for 2 minutes before retrying - done diff --git a/buildspec/release/80notify.yml b/buildspec/release/80notify.yml deleted file mode 100644 index 062895d09d0..00000000000 --- a/buildspec/release/80notify.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 0.2 - -phases: - install: - runtime-versions: - nodejs: 20 - - pre_build: - commands: - # Check for implicit env vars passed from the release pipeline. - - test -n "${NOTIFY_URL}" - - test -n "${TARGET_EXTENSION}" - - build: - commands: - - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" - - export EXTENSION_NAME=$([ "$TARGET_EXTENSION" = "amazonq" ] && echo "Amazon Q" || echo "AWS Toolkit") - - export VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);") - - export CHANGELOG=$(cat packages/${TARGET_EXTENSION}/CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print if $. == 2') - - MESSAGE=$(envsubst < ./buildspec/release/notify.txt | jq -R -s '.') - - echo "Will post message - \n\n${MESSAGE}\n" - - echo "Full command - 'curl -v POST \"[NOTIFY_URL]\" -H \"Content-Type:application/json\" --data \"{\"Content\":${MESSAGE}}\"'" - - | - if [ "$STAGE" != "prod" ]; then - echo "SKIPPED (stage=${STAGE}): curl -v POST ..." - exit 0 - fi - curl -v POST "${NOTIFY_URL}" -H "Content-Type:application/json" --data "{\"Content\":${MESSAGE}}" diff --git a/buildspec/release/notify.txt b/buildspec/release/notify.txt deleted file mode 100644 index 919ee5f4be0..00000000000 --- a/buildspec/release/notify.txt +++ /dev/null @@ -1,6 +0,0 @@ -Released ${EXTENSION_NAME} v${VERSION} for VS Code - -${CHANGELOG} - -Changelog: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/${TARGET_EXTENSION}/CHANGELOG.md -Release Artifact: https://github.com/aws/aws-toolkit-vscode/releases/tag/${TARGET_EXTENSION}/v${VERSION} \ No newline at end of file