Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
185252f
Update CSP for CodeEditor
Aug 8, 2024
5dbec92
Merge pull request #43 from zuoyuanh/1.3
aws-pangestu Aug 19, 2024
3204978
Further restrict CSP for CodeEditor
Oct 2, 2024
c1eed2e
Move .sagemaker-last-active-timestamp to /tmp/
aws-asolidu Oct 15, 2024
b8c7f35
Merge pull request #83 from aws-asolidu/1.3-move-tmp
aws-asolidu Oct 16, 2024
ecfe4e1
Add warning message on auto update being turned off
Oct 18, 2024
f89a978
Merge pull request #84 from zuoyuanh/1.3
zuoyuanh Oct 22, 2024
13762ab
Add sagemaker-open-notebook-extension
Oct 14, 2024
dacc210
Merge pull request #88 from aws-asolidu/1.4
aws-asolidu Oct 23, 2024
b889019
feat:enable deeplink for eks notebook
Nov 1, 2024
941a918
Merge pull request #89 from cinlo/1.4
aws-asolidu Nov 6, 2024
12d224e
Patch braces and micromatch
Nov 4, 2024
78bb728
Merge pull request #92 from zuoyuanh/1.4
zuoyuanh Nov 6, 2024
ba10cc1
fix:validate region from url params to prevent xss attack
Dec 3, 2024
84f6301
Merge pull request #95 from cinlo/1.4
aws-asolidu Dec 11, 2024
123d057
Idle endpoint creates metadata file if not exist
Dec 7, 2024
acba5c3
Merge pull request #98 from zuoyuanh/1.4
zuoyuanh Dec 30, 2024
0c026c5
Add SageMaker-UI env endpoint patch
Mar 17, 2025
c869500
Add SageMaker-UI DER creds endpoint patch
Mar 17, 2025
0f20b9c
Merge pull request #101 from bharathGuntamadugu/feature/smus
aws-asolidu Mar 18, 2025
5559823
Revert "Merge pull request #101 from bharathGuntamadugu/feature/smus"
Mar 24, 2025
914e854
Merge pull request #107 from bharathGuntamadugu/feature/smus
aws-asolidu Mar 25, 2025
3983b4d
feat(session): add SageMaker Unified Studio portal redirect
Mar 21, 2025
71c53cc
feat: Add SageMaker UI Dark Theme extension
hurstsad Mar 25, 2025
3cd6872
Merge pull request #110 from hurstsad/feature/smus
aws-asolidu Mar 27, 2025
d864d99
Fix patch merge failures from feature/smus remote branch
Mar 27, 2025
987c455
Move resource metadata parsing logic in helper function
Mar 27, 2025
d2c8ec2
Add SageMaker-UI poststartup endpoint patch
mndeshmu97 Mar 27, 2025
14911e3
Fix typo for postStartupScriptPath
mndeshmu97 Mar 27, 2025
8771d5b
Merge remote-tracking branch 'upstream/feature/smus' into feature/smu…
Mar 28, 2025
310e702
Merge pull request #111 from mndeshmu97/feature/smus
aws-asolidu Mar 28, 2025
76c3d33
Merge remote-tracking branch 'upstream/feature/smus' into feature/smu…
Mar 28, 2025
c9e64a3
Merge pull request #106 from arunbhati/feature/smus-sagemaker-extension
aws-asolidu Mar 28, 2025
6a7ad26
Post startup script notifications extension for Code Editor
Mar 28, 2025
e39b540
Fix: dirs.js and gulpfile.extensions.js indentation
Mar 31, 2025
b3f3325
Merge pull request #113 from astitv-sh/feature/smus
aws-asolidu Mar 31, 2025
8f06ad7
feat: Add tests for SageMaker UI Dark Theme extension
hurstsad Mar 31, 2025
7cb83ed
Fix: dirs.js and gulpfile.extensions.js patching errors
Mar 31, 2025
8fc4a34
Fix: Spacing issues and yarn.lock file, vscode engine versions
Mar 31, 2025
ec5cc4e
Merge pull request #114 from astitv-sh/feature/smus
aws-asolidu Apr 1, 2025
2637c06
Merge pull request #115 from hurstsad/feature/smus
aws-asolidu Apr 1, 2025
7f1ab5c
Fix: Extension build issues during conda packaging
Apr 2, 2025
cfd9b3b
Merge pull request #116 from astitv-sh/feature/smus
aws-asolidu Apr 2, 2025
d09da0a
upgraded tar-fs from 2.1.1 to 2.1.2
aws-zamesjhu Apr 11, 2025
e7d1380
Feat: Add sagemaker-extensions-sync
aws-pangestu Apr 11, 2025
34728b6
Upgrade tar-fs from 2.1.1 to 2.1.2
aws-pangestu Apr 11, 2025
51794a2
Merge branch 'aws:1.5' into 1.5
aws-pangestu Apr 11, 2025
751bc22
Feat: add sagemaker-extensions-sync
aws-pangestu Apr 11, 2025
57d2634
Fix: changing display language
aws-pangestu Apr 12, 2025
d06bb3f
Fix: Add NLS configuration to workbench.html
aws-pangestu Apr 12, 2025
5c1a58b
Fix: correct line numbers in open-notebook-extension patch
aws-pangestu Apr 12, 2025
c17a34c
Merge pull request #123 from aws-pangestu/1.5-display-language
aws-asolidu Apr 14, 2025
60ea254
Add patch to support custom extensions marketplace
manGitAcc May 14, 2025
e893c58
Merge pull request #130 from manGitAcc/1.6
manGitAcc May 15, 2025
3e31fde
Patch extensionResourceLoader.ts
manGitAcc May 27, 2025
9bb9080
Remove unused import
manGitAcc May 27, 2025
b66490c
remove unused import
manGitAcc May 27, 2025
0546336
Add env to code-server.sh
manGitAcc May 28, 2025
b6eb09c
Revert "Add env to code-server.sh"
manGitAcc May 28, 2025
ce786e0
Merge pull request #131 from manGitAcc/1.6
manGitAcc May 28, 2025
6c8bfac
Update code oss version to 1.100.2
May 17, 2025
65668b6
Copy resources before creating tarball
aws-pangestu Jun 12, 2025
e982e69
Update tar-fs to 2.1.3
aws-pangestu Jun 12, 2025
9e43a1b
Update patched-vscode with tar-fs 2.1.3
aws-pangestu Jun 13, 2025
b4047bb
Further restrict CSP for CodeEditor
pilgd-aws Jul 7, 2025
b09fb41
Further restrict CSP for CodeEditor
pilgd-aws Jul 8, 2025
65e7b83
Merge pull request #148 from pilgd-aws/1.6a
pilgd-aws Jul 11, 2025
204a475
add github actions
pilgd-aws Jul 11, 2025
a24d64a
QCLI PostStartUp Notification changes
athkulk Jul 22, 2025
055fd36
Merge pull request #151 from athkulk/1.7-changes
NewtonDer Jul 22, 2025
7dade60
removed update feedstock part which need personal token
Jul 22, 2025
8a7cf33
updated the post-startup-notifcations patches file
athkulk Jul 22, 2025
34018f5
add new lines to post-startup-notifications.patch
athkulk Jul 22, 2025
966701e
revert adding new line in post-startup-notifications.patch
athkulk Jul 22, 2025
b83c4a1
Merge pull request #154 from athkulk/new-1.7
NewtonDer Jul 22, 2025
0ee4f1d
Update release.yml to remove v of tarball name
harvenstar Jul 22, 2025
31e82a2
Merge pull request #156 from harvenstar/1.7.0
NewtonDer Jul 22, 2025
62eddb2
feat: add build and release workflow
Jul 25, 2025
53d9e19
feat: add build and release workflow
Jul 25, 2025
1f00632
feat: add release workflow to main
Jul 28, 2025
9e2b70d
feat: add release workflow to main
Jul 28, 2025
28d1d41
feat: add build and release workflow to main
Jul 28, 2025
8c5f611
feat: add build and release workflow to main
Jul 28, 2025
20a391b
feat: add build and release workflow to main
Jul 28, 2025
3e4de77
feat: add build and release workflow to main
Jul 28, 2025
87d7439
feat: add build and release workflow to main
Jul 28, 2025
f2b7dfc
Merge pull request #161 from harvenstar/1.8
harvenstar Jul 28, 2025
b431f89
feat: add build and release workflow to main
Jul 28, 2025
e1649a6
Update build.yml and release.yml
harvenstar Jul 28, 2025
8664b7a
Update build.yml and release.yml
harvenstar Jul 28, 2025
e5a8798
Update release.yml
harvenstar Jul 28, 2025
f407ffb
Update release.yml
harvenstar Jul 28, 2025
dd6e1ef
feat: add build and release workflow to main
Jul 28, 2025
e7073c9
Update release.yml
harvenstar Jul 28, 2025
d74057d
Update release.yml
harvenstar Jul 28, 2025
2dfae9d
Update release.yml
harvenstar Jul 28, 2025
b5be6c9
Update release.yml
harvenstar Jul 28, 2025
3f35c82
Update build.yml
harvenstar Jul 29, 2025
a617d20
Update build.yml
harvenstar Jul 29, 2025
31051bc
Merge pull request #162 from harvenstar/1.8
harvenstar Aug 1, 2025
e2526cb
Add unit test and e2e test placeholders to build workflow
Aug 1, 2025
0a45c36
Add unit test and e2e test placeholders to build workflow
Aug 1, 2025
f4016f1
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
726858b
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
b02e2b2
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
247badb
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
54bb05f
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
a1b3af9
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
dceea6c
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
866a924
Update release.yml
harvenstar Aug 4, 2025
eee55fe
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
4b58391
Add unit test and e2e test placeholders to build workflow
Aug 4, 2025
05ab0c4
Merge branch '1.8' into 1.8
harvenstar Aug 4, 2025
5a44e1c
Merge pull request #164 from harvenstar/1.8
harvenstar Aug 4, 2025
bc6802e
Add unit test and e2e test placeholders to build workflow
Aug 5, 2025
7924f60
Merge pull request #165 from harvenstar/1.8
harvenstar Aug 5, 2025
dd79d24
Add unit test and e2e test placeholders to build workflow
Aug 5, 2025
27952fe
Merge pull request #166 from harvenstar/1.8
harvenstar Aug 5, 2025
24e1d1e
Update build.yml
harvenstar Aug 5, 2025
fb07a73
Merge pull request #21 from aws/1.8
harvenstar Aug 5, 2025
b0cac46
Update build.yml
harvenstar Aug 5, 2025
248d99b
Add base-path compatibility patch for VS Code 1.100.2
aakashmandavilli96 Aug 12, 2025
97bb3b7
Merge pull request #170 from aws/feature/base-path-compatibility
sgganjo Aug 13, 2025
4b3f8dd
Merge pull request #168 from harvenstar/1.8
NewtonDer Aug 13, 2025
fd0a2b0
Fix base-path-compatibility patch for VS Code 1.100.2
aakashmandavilli96 Aug 15, 2025
0edf6bb
Merge pull request #171 from aws/feature/base-path-compatibility
aakashmandavilli96 Aug 15, 2025
0726fc3
Merge functional changes from 1.7 branch (excluding July 25 commits)
aakashmandavilli96 Aug 20, 2025
a54d958
Merge pull request #174 from aws/merge-1.7-to-1.8
NewtonDer Aug 20, 2025
64d99f0
security patch: fix CVEs in sagemaker-code-editor v1.8
pilgd-aws Aug 22, 2025
cdcfb62
Merge pull request #179 from pilgd-aws/1.8
pilgd-aws Aug 26, 2025
393d7a2
Update code oss version to 1.101.2
aakashmandavilli96 Aug 22, 2025
d5a0c05
Modify build so build halts when patch fails
aws-ajangg Aug 27, 2025
d9520d5
Fix: Halt workflow run with first failing patch
aws-ajangg Aug 27, 2025
f24ffa0
Fix: Exit upon initial patch failure
aws-ajangg Aug 27, 2025
288cc0e
Fix: Halt workflow when first patch fails
aws-ajangg Aug 27, 2025
7f91afb
Merge pull request #3 from austinjang2/1.8
austinjang2 Aug 27, 2025
4f057cd
Fix the sagemaker-idle-extension.patch
aakashmandavilli96 Aug 29, 2025
cc06fb2
Remove the displayLanguage.patch,sagemaker-ui-post-startup.patch and …
aakashmandavilli96 Aug 29, 2025
d5fa177
Update series to remove the custom-extensions-marketplace.patch
aakashmandavilli96 Sep 2, 2025
c115a7f
Fix the sagemaker-idle-extension.patch
aakashmandavilli96 Sep 2, 2025
6fd2b97
Fix the Sagemaker-ui-post-startup.patch
aakashmandavilli96 Sep 2, 2025
3741316
Merge pull request #180 from aakashmandavilli96/srmanda1.8
NewtonDer Sep 3, 2025
f4238e8
Fix Custom Extension Patch and add to series
aakashmandavilli96 Sep 3, 2025
d2ef6e7
Add the Signature Verification fix seprate signature-verification.dif…
aakashmandavilli96 Sep 4, 2025
c36a732
Merge pull request #189 from aakashmandavilli96/srmanda1.8
aakashmandavilli96 Sep 4, 2025
4b027e1
Fix: Display-language.patch updated
aws-ajangg Sep 4, 2025
f65a067
Fix: Display-language.patch updated
aws-ajangg Sep 4, 2025
d35a49b
Fix: Display-language.patch updated
aws-ajangg Sep 4, 2025
7a8a689
Fix: Display-language.patch updated
aws-ajangg Sep 4, 2025
3420eea
Fix: Display-language.patch update
aws-ajangg Sep 4, 2025
161ab4f
Fix: Add custom-extensions-marketplace.diff changes
aws-ajangg Sep 4, 2025
8683251
Fix 2.0: Update display-language.patch and series
aws-ajangg Sep 4, 2025
6b05744
Fix 3.0: Update display-language.patch
aws-ajangg Sep 5, 2025
faeda13
Merge branch '1.8' into ajangg1.8
austinjang2 Sep 5, 2025
dcf18f0
Update import
austinjang2 Sep 5, 2025
865c082
rebase to updated series
aws-ajangg Sep 5, 2025
17be254
Merge pull request #192 from austinjang2/ajangg1.8
aakashmandavilli96 Sep 8, 2025
251e328
ci: implement GitHub Actions CI/CD pipeline …
aakashmandavilli96 Sep 9, 2025
e1451a8
Merge pull request #196 from aakashmandavilli96/sri1.8
NewtonDer Sep 11, 2025
05846a2
Added local build support for local testing
Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-P ubuntu-latest=node:22-bookworm
--container-options=--memory=32g --network=host
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Exclude large directories that aren't needed for build
vscode/node_modules

# Exclude build artifacts
*.tar.gz
*.log

# Exclude development files
.vscode/
.idea/
*.swp
*.swo
*~

# Exclude OS files
.DS_Store
Thumbs.db
109 changes: 109 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
# The main job for building the application
build:
name: Build sagemaker-code-editor
runs-on: ubuntu-latest
timeout-minutes: 180
env:
DISABLE_V8_COMPILE_CACHE: 1

steps:
- name: Checkout repo with submodules
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y make gcc g++ libx11-dev xorg-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python3 jq perl gettext automake autoconf quilt

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Apply patches (if any)
run: |
if [ -d patches ] && [ "$(ls -A patches)" ]; then
{
quilt push -a --leave-rejects --color=auto
} || {
printf "\nPatching error, review logs!\n"
find ./vscode -name "*.rej"
exit 1
}
fi

- name: Set Development Version
id: version
run: |
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
VERSION="0.0.0-dev-${SHORT_SHA}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Generated version for this build: $VERSION"

- name: Build vscode
run: |
cd vscode
export DISABLE_V8_COMPILE_CACHE=1
export UV_THREADPOOL_SIZE=4

npm install -g node-gyp

# Install dependencies using npm, skip optional and native modules
npm install

# Run the gulp build task with memory optimizations
ARCH_ALIAS=linux-x64
node --max-old-space-size=32768 --optimize-for-size \
./node_modules/gulp/bin/gulp.js \
"vscode-reh-web-${ARCH_ALIAS}-min"

- name: Find build output
id: find_output
run: |
BUILD_PATH=$(find . -name "vscode-reh-web-linux-x64" -type d | head -n 1)
if [ -z "$BUILD_PATH" ]; then
echo "::error::Build output directory 'vscode-reh-web-linux-x64' not found!"
exit 1
fi
echo "Build output found at: $BUILD_PATH"
echo "build_path=$BUILD_PATH" >> $GITHUB_OUTPUT

- name: Rename build output directory
id: rename_output
run: |
ORIG_PATH="${{ steps.find_output.outputs.build_path }}"
PARENT_DIR=$(dirname "$ORIG_PATH")
mv "$ORIG_PATH" "$PARENT_DIR/sagemaker-code-editor"
echo "Renamed build output directory to: $PARENT_DIR/sagemaker-code-editor"
echo "build_path=$PARENT_DIR/sagemaker-code-editor" >> $GITHUB_OUTPUT

- name: Create tarball archive
run: |
TARBALL="sagemaker-code-editor-${{ env.VERSION }}.tar.gz"
BUILD_DIR_PATH="${{ steps.rename_output.outputs.build_path }}"
PARENT_DIR=$(dirname "$BUILD_DIR_PATH")
BUILD_DIR_NAME=$(basename "$BUILD_DIR_PATH")
echo "Creating '$TARBALL' from '$BUILD_DIR_NAME' in '$PARENT_DIR'"
tar czf $TARBALL -C "$PARENT_DIR" "$BUILD_DIR_NAME"

- name: Upload build artifact
if: env.ACT == ''
uses: actions/upload-artifact@v4
with:
name: npm-package
path: sagemaker-code-editor-${{ env.VERSION }}.tar.gz
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
run-unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
# Checkout repository code
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

# Verify CSP line exists in target TypeScript file
- name: Check CSP configuration in webClientServer.ts
run: |
TARGET_FILE="patched-vscode/src/vs/server/node/webClientServer.ts"
REQUIRED_TEXT="'connect-src \'self\' ws: wss: https://main.vscode-cdn.net http://localhost:* https://localhost:* https://login.microsoftonline.com/ https://update.code.visualstudio.com https://*.vscode-unpkg.net/ https://default.exp-tas.com/vscode/ab https://vscode-sync.trafficmanager.net https://vscode-sync-insiders.trafficmanager.net https://*.gallerycdn.vsassets.io https://marketplace.visualstudio.com https://openvsxorg.blob.core.windows.net https://az764295.vo.msecnd.net https://code.visualstudio.com https://*.gallery.vsassets.io https://*.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com https://*.servicebus.windows.net/ https://vscode.blob.core.windows.net https://vscode.search.windows.net https://vsmarketplacebadges.dev https://vscode.download.prss.microsoft.com https://download.visualstudio.microsoft.com https://*.vscode-unpkg.net https://open-vsx.org;'"

if [ ! -f "$TARGET_FILE" ]; then
echo "❌ FAIL: Target file $TARGET_FILE does not exist."
exit 1
fi

if grep -F "$REQUIRED_TEXT" "$TARGET_FILE" > /dev/null; then
echo "✅ PASS: Required CSP text exists."
else
echo "❌ FAIL: Required CSP text NOT found in $TARGET_FILE"
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: E2E Tests

on:
workflow_run:
workflows: ["Build"]
types: [completed]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-tests:
name: E2E tests
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'pull_request'
steps:
- name: Checkout repo with submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Run E2E tests
run: |
# Add your actual E2E test commands here
echo "[PLACEHOLDER] Running E2E tests..."
# Example: npm run test:e2e
- uses: actions/upload-artifact@v4
if: failure()
with:
name: e2e-test-results
path: test-results/
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Workflow name
name: Release

# This workflow is triggered manually from the GitHub Actions tab.
on:
workflow_dispatch:
inputs:
version:
description: 'The release version (e.g., v1.8.0). This will be used to create the Git tag.'
required: true
type: string
# This input specifies the branch to tag and release from.
source_branch:
description: 'The branch to create the release from (e.g., main or 1.8). This branch MUST have the final code.'
required: true
type: string
default: 'main'

jobs:
# The job for creating a release
create-release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
# This permission is required for creating a release and uploading assets.
contents: write

steps:
# Step 1: Check out the code from the SPECIFIED BRANCH in the AWS repository.
- name: Checkout code
uses: actions/checkout@v4
with:
# This ensures we are on the correct branch to get the latest code.
ref: ${{ github.event.inputs.source_branch }}
# CRITICAL: We check out the code from the AWS repository directly.
repository: aws/sagemaker-code-editor

# Step 2: Explicitly get the commit SHA of the checked-out branch HEAD.
- name: Get commit SHA
id: get_sha
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

# Step 3: Delete existing tag in the AWS repo if you want to re-run the release.
- name: Delete existing tag (if any)
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tag = '${{ github.event.inputs.version }}';
try {
await github.rest.git.deleteRef({
owner: 'aws',
repo: 'sagemaker-code-editor',
ref: `tags/${tag}`
});
console.log(`Deleted existing tag: ${tag}`);
} catch (e) {
if (e.status !== 404 && e.status !== 422) {
// Re-throw the error if it's not a "Not Found" or "Unprocessable" error
throw e;
}
console.log(`Tag ${tag} does not exist or already deleted.`);
}


# Step 4: Download the build artifact from the UPSTREAM repository after a PUSH event.
- name: Download artifact from build workflow
uses: dawidd6/action-download-artifact@v6
with:
# CRITICAL: Explicitly specify the repository where the build artifact was created.
repo: aws/sagemaker-code-editor
# BEST PRACTICE: Look for artifacts created by a 'push' event (e.g., after a PR is merged).
event: push
workflow: build.yml
branch: ${{ github.event.inputs.source_branch }}
name: npm-package
path: ./release-assets
workflow_conclusion: success

# Step 5: Prepare the release assets by renaming the artifact.
- name: Prepare release assets
id: prepare_assets
run: |
# Find the downloaded tarball (there should only be one).
ARTIFACT_FILE=$(find ./release-assets -name "*.tar.gz")

if [ -z "$ARTIFACT_FILE" ]; then
echo "::error::Build artifact not found! Ensure a 'build.yml' workflow ran successfully on the '${{ github.event.inputs.source_branch }}' branch in 'aws/sagemaker-code-editor' after the code was pushed/merged."
exit 1
fi

# Get the version from the manual input, and remove the leading 'v' if it exists.
VERSION_TAG="${{ github.event.inputs.version }}"
VERSION_NUM="${VERSION_TAG#v}"

# Create the new, clean filename for the release.
NEW_FILENAME="code-editor${VERSION_NUM}.tar.gz"

# Rename the file.
mv "$ARTIFACT_FILE" "./release-assets/$NEW_FILENAME"

echo "Renamed artifact to $NEW_FILENAME"
# Set the new filename as an output for the next step.
echo "filename=./release-assets/$NEW_FILENAME" >> $GITHUB_OUTPUT

# Step 6: Create the GitHub Release in the AWS repo using the CORRECT commit SHA.
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
# We need a token with permissions to create releases in the AWS repo.
token: ${{ secrets.GITHUB_TOKEN }}
# CRITICAL: Explicitly specify the repository to create the release in.
repository: aws/sagemaker-code-editor
name: CodeEditor ${{ github.event.inputs.version }}
tag_name: ${{ github.event.inputs.version }}
files: ${{ steps.prepare_assets.outputs.filename }}
draft: false
generate_release_notes: false
# CRITICAL: Force the tag to be created on the commit we explicitly got in Step 2.
target_commitish: ${{ steps.get_sha.outputs.sha }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.DS_Store
.pc
.pc
.artifacts
bin
Loading