Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,ts,json}]
indent_size = 2
indent_style = space
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
// "airbnb",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"project": "./tsconfig.json"
},
"ignorePatterns": [
"dist"
],
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"quotes": ["warn", "single"],
"@typescript-eslint/no-floating-promises": ["error"]
}
}
96 changes: 96 additions & 0 deletions .github/workflows/Publish-To-NPM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This workflow will build and run tests using node and then publish a package to the public NPM repository
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish-To-NPM

on: [workflow_dispatch]

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
GIT_COMMITTER_NAME: ActionsDevKitRelease
GIT_COMMITTER_EMAIL: cawsactionextensions+adk-release@amazon.com

jobs:
release-to-prod:
runs-on: ubuntu-latest
permissions: write-all
steps:
# Allows to push to the main branch for
- name: Git & SSH auth setup
run: |
sudo git config --system --add safe.directory "*"
if [[ -n $SSH_PUBLIC_KEY && -n $SSH_PRIVATE_KEY ]]; then
echo "SSH Key pair found, configuring signing..."
mkdir ~/.ssh
echo -e "$SSH_PRIVATE_KEY" >> ~/.ssh/signing_key
cat ~/.ssh/signing_key
echo -e "$SSH_PUBLIC_KEY" >> ~/.ssh/signing_key.pub
cat ~/.ssh/signing_key.pub
chmod 600 ~/.ssh/signing_key && chmod 600 ~/.ssh/signing_key.pub
eval "$(ssh-agent)"
ssh-add ~/.ssh/signing_key
git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/signing_key
git config --global commit.gpgsign true
git config --global user.email $GIT_COMMITTER_EMAIL
git config --global user.name $GIT_COMMITTER_NAME
touch ~/.ssh/allowed_signers
echo "$GIT_COMMITTER_EMAIL $SSH_PUBLIC_KEY" > ~/.ssh/allowed_signers
git config --global gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers
fi
# Checkout main branch
- uses: actions/checkout@v4
with:
# Checkout with ssh key to be able to push changes back to the branch.
# The expected changes are:
# - a version bump in the package.json files
# - New commit that begins with chore(release):
# - New tag for the new version release
ssh-key: ${{ env.SSH_PRIVATE_KEY }}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org/'
cache: 'yarn'
scope: '@aws'
# Install dependencies
- run: npm install -g npm@6.14.13
- run: yarn --version
- run: npm --version

# Yarn Install
- run: yarn --immutable-cache

# Build project (also runs tests and packages dist) See packages/adk/adk-utils/.projen/tasks.json
- run: yarn build

# Bump all package versions
- run: yarn projen bump
- run: NEW_ADK_RELEASE_VERSION=`jq -r .version packages/adk/adk/package.json`
- run: NEW_WORKFLOWS_SDK_RELEASE_VERSION=`jq -r .version packages/workflows/workflows-sdk/package.json`

# Add and show changes
- run: git add .
- run: git status


# Commit changes and create new version tag
- run: RELEASE_COMMIT_MESSAGE="chore(release) release ADK v$NEW_ADK_RELEASE_VERSION and workflows-sdk v$NEW_WORKFLOWS_SDK_RELEASE_VERSION"
- run: git commit -m "$RELEASE_COMMIT_MESSAGE"
- run: git tag -a v$NEW_ADK_RELEASE_VERSION HEAD -m "$RELEASE_COMMIT_MESSAGE"

# Push commits and tag
- run: git push origin HEAD:main
- run: git push origin v$NEW_ADK_RELEASE_VERSION

# Ensure changes are up to date
- run: git status
- run: git pull

# Publishes packages to NPM https://www.npmjs.com/~adk-npm-public-release
- run: yarn projen npm:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50 changes: 22 additions & 28 deletions .github/workflows/actions-dev-kit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,41 @@
# - performs vulnerabilities scan using returntocorp/semgrep GHA

name: adk-ci

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches: [main, gamma]
types: [assigned, opened, synchronize, reopened]

env:
PROJEN_DISABLE_POST: '1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Target branch of the pull request
# Source https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
ref: ${{ github.base_ref }}
- uses: actions/setup-node@v4
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install --global lerna yarn #install global dependencies
- run: yarn install #install and link depdendencies
- run: ./build.sh #build
- run: yarn run api-ref #test generate /docs
- run: yarn run api-ref-pre-release #test generate /pre-release-docs
- run: yarn run generate-attributions #test generate ./<package>/THIRD_PARTY_LICENSES

node-version: '18'
cache: 'yarn'
# We are seeing a very large slow down in startup execution in with npx (npm v9.7.2).
# Setting to older version of npm to speed up execution.
- run: npm install -g npm@6.14.13
- run: yarn --immutable-cache
- run: yarn build
secret-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@v3.63.1
fetch-depth: 1
- uses: trufflesecurity/trufflehog@main
with:
path: ./
# Target branch of the pull request
# Source https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
base: ${{ github.base_ref }}
head: HEAD
extra_args: --debug

extra_args: --only-verified --debug

semgrep:
runs-on: ubuntu-latest

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/actions-dev-kit-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ jobs:
# Checkout with ssh key to be able to push changes back to the branch
ssh-key: ${{ env.SSH_PRIVATE_KEY }}
# Install dependencies
- run: npm install --global lerna@5.0.0 yarn@1.22.18
- run: lerna --version
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- run: npm install -g npm@6.14.13
- run: yarn --version
- run: npm --version

- run: yarn install # install dependencies
- run: yarn run all #build
- run: yarn --immutable-cache
- run: yarn build
- run: yarn run api-ref #generate /docs
# Commit /docs folder back to the main branch. GitHub then deploys it automatically to GitHub pages
- run: git status && git add . && git add -f docs
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_modules/
.vscode/
lerna-debug.log
dist/
docs/
pre-release-docs/
**/coverage/
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.16.1
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
*.json
*.yaml
*.yml
.eslintrc
**/templates/**
coverage
dist
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"arrowParens": "avoid",
"bracketSpacing": true,
"printWidth": 150,
"proseWrap": "always",
"quoteProps": "consistent",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
5 changes: 3 additions & 2 deletions .semgrepignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# To ignore a file with a literal ':' character, escape it with
# a backslash, e.g. "\:foo".

/packages/adk/lib/util/template.ts
/packages/adk/adk/src/util/template.ts
/docs/index.html
/scripts/generate-attributions.ts
/scripts/generate-attributions.ts
/packages/workflows/workflows-sdk/**.ts
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading