Skip to content

Commit 106666e

Browse files
committed
release/30closegate.yml
1 parent d8648ea commit 106666e

File tree

5 files changed

+136
-2
lines changed

5 files changed

+136
-2
lines changed

buildspec/release/00clonerepo.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ version: 0.2
33
env:
44
variables:
55
NODE_OPTIONS: '--max-old-space-size=8192'
6-
# Implicitly passed by the release pipeline:
7-
# TOOLKITS_GITHUB_REPO_OWNER
86

97
phases:
108
install:
119
runtime-versions:
1210
nodejs: 16
1311

12+
pre_build:
13+
commands:
14+
# Check for implicit env vars passed from the release pipeline.
15+
- test -n "${TOOLKITS_GITHUB_REPO_OWNER}"
16+
1417
build:
1518
commands:
1619
- git clone https://github.com/${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode.git aws-toolkit-vscode

buildspec/release/30closegate.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
nodejs: 16
7+
8+
pre_build:
9+
commands:
10+
- STAGE_NAME=Release
11+
- PIPELINE=$(echo $CODEBUILD_INITIATOR | sed -e 's/codepipeline\///')
12+
build:
13+
commands:
14+
- |
15+
aws codepipeline disable-stage-transition \
16+
--pipeline-name "$PIPELINE" \
17+
--stage-name "$STAGE_NAME" \
18+
--transition-type "Inbound" \
19+
--reason "Disabled by CloseGate (automation)"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
NODE_OPTIONS: '--max-old-space-size=8192'
6+
7+
phases:
8+
install:
9+
runtime-versions:
10+
nodejs: 16
11+
12+
pre_build:
13+
commands:
14+
# Check for implicit env vars passed from the release pipeline.
15+
- test -n "${TOOLKITS_GITHUB_REPO_OWNER}"
16+
- test -n "${GITHUB_TOKEN}"
17+
- REPO_URL="https://[email protected]/${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode.git"
18+
19+
build:
20+
commands:
21+
- |
22+
git config --global user.name "aws-toolkit-automation"
23+
git config --global user.email "<>"
24+
git remote add originWithCreds "$REPO_URL"
25+
echo "Adding SNAPSHOT to next version string"
26+
# Increase minor version
27+
npm version --no-git-tag-version minor
28+
VERSION=$(node -e "console.log(require('./package.json').version);")
29+
# Append -SNAPSHOT
30+
npm version --no-git-tag-version "${VERSION}-SNAPSHOT"
31+
git add package.json
32+
git add package-lock.json
33+
git commit -m "Update version to snapshot version: ${VERSION}-SNAPSHOT"
34+
- |
35+
if [ "$STAGE" != "prod" ]; then
36+
echo "Stage is not production, skipping github push step"
37+
exit 0
38+
fi
39+
echo "pushing to github"
40+
git push originWithCreds --tags
41+
git push originWithCreds master
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
nodejs: 16
7+
8+
Commands:
9+
# GitHub recently changed their GPG signing key for their CLI tool
10+
# These are the updated installation instructions:
11+
# https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
12+
- curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
13+
- chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
14+
- 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
15+
- apt update
16+
- apt install gh -y
17+
18+
pre_build:
19+
commands:
20+
# Check for implicit env vars passed from the release pipeline.
21+
- test -n "${TOOLKITS_GITHUB_REPO_OWNER}"
22+
- REPO="${TOOLKITS_GITHUB_REPO_OWNER}/aws-toolkit-vscode"
23+
24+
build:
25+
commands:
26+
# pull in the build artifacts
27+
- cp -r ${CODEBUILD_SRC_DIR_buildPipeline}/* .
28+
- VERSION=$(node -e "console.log(require('./package.json').version);")
29+
- UPLOAD_TARGET=$(ls aws-toolkit-vscode*.vsix)
30+
- HASH_UPLOAD_TARGET=${UPLOAD_TARGET}.sha384
31+
- 'HASH=$(sha384sum -b $UPLOAD_TARGET | cut -d" " -f1)'
32+
- echo "Writing hash to $HASH_UPLOAD_TARGET"
33+
- echo $HASH > $HASH_UPLOAD_TARGET
34+
- echo "posting $VERSION with sha384 hash $HASH to GitHub"
35+
- RELEASE_MESSAGE="AWS Toolkit for VS Code $VERSION"
36+
- |
37+
if [ $STAGE = "prod" ]; then
38+
gh release create --repo $REPO --title "$VERSION" --notes "$RELEASE_MESSAGE" -- "v$VERSION" "$UPLOAD_TARGET" "$HASH_UPLOAD_TARGET"
39+
else
40+
echo "SKIPPED: 'gh release create --repo $REPO'"
41+
fi

buildspec/release/60publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Publishes the release vsix to the marketplace.
3+
#
4+
5+
version: 0.2
6+
7+
phases:
8+
install:
9+
runtime-versions:
10+
nodejs: 16
11+
commands:
12+
- apt-get update
13+
- apt-get install -y libsecret-1-dev
14+
15+
pre_build:
16+
commands:
17+
# Check for implicit env vars passed from the release pipeline.
18+
- test -n "${VS_MARKETPLACE_PAT}"
19+
20+
build:
21+
commands:
22+
# pull in the build artifacts
23+
- cp -r ${CODEBUILD_SRC_DIR_buildPipeline}/* .
24+
- |
25+
if [ "$STAGE" != "prod" ]; then
26+
echo "Stage is not production, skipping publish step"
27+
exit 0
28+
fi
29+
UPLOAD_TARGET=$(ls aws-toolkit-vscode*.vsix)
30+
npx vsce publish --pat "$VS_MARKETPLACE_PAT" --packagePath "$UPLOAD_TARGET"

0 commit comments

Comments
 (0)