Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# Continuous Delivery (Release)
name: cd

Expand All @@ -12,8 +11,8 @@ jobs:
name: Prepare for NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
Expand All @@ -28,47 +27,44 @@ jobs:
npm pack
- name: Upload NPM Artifacts
id: upload_npm
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: package-npm
path: cfn-rpdk-${{ env.VERSION }}.tgz

delivery-python:
name: Prepare for PyPI
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8]
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: "3.12"
- name: Install Dependencies and Package Project
id: installing
run: |
python -m pip install --upgrade pip setuptools wheel
python3 setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-py${{ matrix.python }}
name: dist-python
path: dist

delivery-github:
name: Delivery to GitHub
needs: [delivery-nodejs, delivery-python]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download NPM Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: package-npm
- name: Download Python 3.8 Artifacts
uses: actions/download-artifact@v3
- name: Download Python Artifacts
uses: actions/download-artifact@v4
with:
name: dist-py3.8
name: dist-python
path: dist/
- name: List Artifacts
run: |
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# Continous Integration
name: ci

Expand All @@ -8,17 +7,29 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.12"
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install and Build
run: |
npm ci --include=optional
npm run build
- name: TypeScript Tests
run: |
npx jest --ci
os_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-12 # Later versions of ARM-based macOS runners fail because the hypervisor framework required for Docker is not supported
python: [ "3.8", "3.9", "3.10", "3.11"]
- macos-13
python: [ "3.10", "3.11", "3.12"]
node: [ 20 ]
env:
SAM_CLI_TELEMETRY: "0"
Expand All @@ -30,14 +41,14 @@ jobs:
PIP_LOG_FILE: /tmp/pip.log
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update Homebrew and save docker version
if: runner.os == 'macOS'
run: |
brew tap homebrew/core
cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/d/docker.rb" > .github/brew-formulae
- name: Configure Homebrew docker cache files
uses: actions/cache@v3
uses: actions/cache@v4
if: runner.os == 'macOS'
with:
path: |
Expand All @@ -51,18 +62,12 @@ jobs:
run: |
brew install docker --cask
brew install colima
# Docker engine is no longer available because of licensing
# Alternative Colima is part of the github macOS runner
# SAM v1.47.0+ needed for colima support, unable to use Python 3.6
colima start
# Ensure colima is configured for later user
echo "DOCKER_HOST=unix://$HOME/.colima/default/docker.sock" >> $GITHUB_ENV
# Verify Docker
docker ps
docker --version
# Verify colima
colima status
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
Expand All @@ -72,19 +77,19 @@ jobs:
mkdir "$LOG_PATH"
pip install --upgrade pip
pip install --upgrade setuptools wheel aws-sam-cli -r https://raw.githubusercontent.com/aws-cloudformation/cloudformation-cli/master/requirements.txt
pip install git+https://github.com/aws-cloudformation/cloudformation-cli.git@master
pip install .
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install Dependencies Node.js
id: install_nodejs
# Touch needed because of https://github.com/aws/aws-cli/issues/2639
run: |
npm ci --include=optional
find ./node_modules/* -mtime +10950 -exec touch {} \;
npm run build
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: ${{ matrix.os }}-${{ env.pythonLocation }}${{ hashFiles('.pre-commit-config.yaml') }}
Expand All @@ -100,9 +105,9 @@ jobs:
bash codecov.sh -f coverage/ts/coverage-final.json -F unittests -n codecov-typescript
- name: Upload Coverage Artifacts
id: upload_coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-${{ matrix.os }}-py${{ matrix.python }}
path: coverage/
- name: Run Integration Tests
id: integration_testing
Expand Down Expand Up @@ -140,7 +145,7 @@ jobs:
- name: Upload Debug Artifacts
id: upload_logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: debug-logs
name: debug-logs-${{ matrix.os }}-py${{ matrix.python }}
path: ${{ env.LOG_PATH }}
25 changes: 25 additions & 0 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will release project to PyPI
name: CloudFormation CLI TypeScript Plugin Release
on:
release:
types: [published]
jobs:
build:
if: endsWith(github.ref, '-plugin')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install --upgrade wheel twine
- name: Package project
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_KEY_CLOUDFORMATION_CLI_TYPESCRIPT_PLUGIN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,5 @@ node_modules/
coverage/

*.iml
# Kiro IDE
.kiro/
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: check-merge-conflict
# - id: check-yaml # have jinja yml templates so skipping this
- repo: https://github.com/pycqa/flake8
rev: "5.0.4"
rev: "7.1.2"
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -45,19 +45,18 @@ repos:
- id: python-check-mock-methods
- id: python-no-log-warn
- repo: https://github.com/PyCQA/bandit
rev: 1.7.1
rev: 1.8.3
hooks:
- id: bandit
files: "^python/"
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.26.0
- repo: local
hooks:
- id: eslint
args: [--fix]
types: []
files: (.*.js$|.*.ts$)
additional_dependencies:
- eslint@8.21.0
name: eslint
description: Run eslint from local node_modules
entry: npx eslint --fix
language: system
files: \.(js|ts)$
- repo: local
hooks:
- id: pylint-local
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib",
"version": "1.0.6",
"version": "1.0.7",
"description": "The CloudFormation Resource Provider Development Kit (RPDK) allows you to author your own resource providers that can be used by CloudFormation. This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation.",
"private": false,
"main": "dist/index.js",
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion python/rpdk/typescript/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging

__version__ = "1.0.4"
__version__ = "1.0.5"

logging.getLogger(__name__).addHandler(logging.NullHandler())
2 changes: 1 addition & 1 deletion python/rpdk/typescript/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"{{lib_name}}": "{{lib_path}}",
"class-transformer": "0.3.1"
"class-transformer": "0.5.1"
},
"devDependencies": {
"@types/node": "^20.0.0",
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def find_version(*file_paths):
# package_data -> use MANIFEST.in instead
include_package_data=True,
zip_safe=True,
python_requires=">=3.8",
python_requires=">=3.10",
install_requires=[
"cloudformation-cli>=0.1.14",
"zipfile38>=0.0.3,<0.2",
Expand All @@ -60,10 +60,9 @@ def find_version(*file_paths):
"Topic :: Software Development :: Code Generators",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
keywords="Amazon Web Services AWS CloudFormation",
)
Loading
Loading