Skip to content

chore(cicd): Add release workflow #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Dec 17, 2021
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
46 changes: 0 additions & 46 deletions .github/workflows/on-pull-request.yml

This file was deleted.

29 changes: 25 additions & 4 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: on-push-event
on:
push

push:
branches:
- '**' # matches every branch
- '!main'
jobs:
on_push:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
env:
NODE_ENV: dev
steps:
Expand All @@ -24,4 +25,24 @@ jobs:
- name: Run lint
run: npm run lerna-lint
- name: Run tests
run: npm run lerna-test
run: npm run lerna-test
- name: Collate Coverage Reports
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
for d in ./packages/*/ ; do
mkdir -p coverage
if [[ ! -f coverage/lcov.info ]]
then
continue
fi
filename="$d""coverage/lcov.info"
targetSource="SF:""$d""src"
sed "s|SF:src|$targetSource|g" $filename >> coverage/lcov.info
done
- name: Report Coverage
#Dependabot user will only have read-only perms, so don't try to report coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: romeovs/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
62 changes: 42 additions & 20 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
name: on-release-event

name: release
on:
release:
types: [created]

push:
branches:
- main
workflow_dispatch: {}
jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: "Setup npm"
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: Install packages
run: |
export NODE_ENV=dev
npm ci
npm run lerna-ci
- name: Run lint
run: npm run lerna-lint
- name: Run tests
run: npm run lerna-test
# TODO: add publish step
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Use NodeJS 14"
uses: actions/setup-node@v2
with:
node-version: '14'

- name: "Setup npm"
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"

- name: Install packages
run: |
npm ci
npm run lerna-ci
- name: Run lint
run: npm run lerna-lint
- name: Run tests
run: npm run lerna-test
- name: "Version and publish"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"

if [ ${{ github.base_ref }} = main ]; then
npx lerna version --conventional-commits --create-release github --yes
else
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --yes
fi
npx lerna publish from-git --no-verify-access --yes
57 changes: 56 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.1.0-beta.9](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.1.0-beta.8...v0.1.0-beta.9) (2021-12-15)


### Bug Fixes

* **metrics:** lib entrypoint ([819098b](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/819098b9e820d0998b6116b659dd456ae65ba20a))





# [0.1.0-beta.8](https://github.com/awslabs/aws-lambda-powertools-typescript/compare/v0.1.0-beta.7...v0.1.0-beta.8) (2021-12-15)

**Note:** Version bump only for package aws-lambda-powertools-typescript





# 0.1.0-beta.7 (2021-12-15)


### Bug Fixes

* **cicd:** Fix/release ([#323](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/323)) ([9df4493](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/9df449370c1441d3c9d7165bc3b161a15dd2e1de))
* **ci:** merge conflict ([97796df](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/97796df7cb7036396459279224d64bd277651e71))
* **ci:** updated github actions commands ([76ba8c7](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/76ba8c76c33db5eba44a50c015880520f04bb54c))
* **ci:** updated NPM dependencies (audit) ([3166c7b](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/3166c7b7c58baa8414121c73f15139f4db0ccf38))
* hosted-git-info bump in logger ([fb2a365](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/fb2a365cc73ae60d6e32d46361265a5ee8f5cad1))
* **logger:** jest set to next version as workaround for vulnerability ([0f423bf](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/0f423bf7479a28829e81fabc6c58ed4e76dcfda4))
* **logging:** removed forgotten dummy folder ([a10791f](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/a10791f5201739ab2f5f7019bbc52ea04cb0d723))
* **metrics:** publish metrics even if handler throw ([#249](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/249)) ([8ad0a6a](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/8ad0a6ac388641a41da08fefee48f6b996544a0a))
* upgrade of dependencies, npm-shrinkwrap for packages/logger ([c120c64](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/c120c64670ac3ed86438267c0a9c9fc72a3f7ebe))
* version bumb for commitlint/cli ([0e1f6be](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/0e1f6be2786779ca43c3fcac6cb9e96431ca585d))


### Features

* add metrics ([#102](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/102)) ([cf22210](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/cf22210ebb519cf0a625a2bdc92d2bcea7b4a59d))
* Adding sample automation for PR ([#121](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/121)) ([7bf63bb](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/7bf63bb8554972f30b450c1cbf100aea2b580162))
* **logger:** add context decorator functionality ([#13](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/13)) ([369e4d1](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/369e4d1595776f4c563b1e9eb803897677df041f))
* **logger:** adding basic crude logger module, and support for log levels by passed param/env param ([a3ff0ba](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/a3ff0bab8f89a51dc3953cdbdcd5cd74aac6db0a))
* **logger:** basic logger logic ([#9](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/9)) ([5f867ea](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/5f867ea8dc43bd315a27d051993625fa699d514a)), closes [#10](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/10)
* **logger:** lint error fixes ([5272ac0](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/5272ac0c12bbfe23395429f8a239f90ac8676b15))
* **logging:** added basic lerna package for the logging module ([14c679d](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/14c679da949cd4b4ef5cd076ce1a7da5132c3cde))





# Changelog

All notable changes to this project will be documented in this file.
Expand All @@ -13,4 +68,4 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) fo

* **tracer:** beta release ([#91](https://github.com/awslabs/aws-lambda-powertools-python/issues/91))
* **logger:** beta release ([#24](https://github.com/awslabs/aws-lambda-powertools-python/issues/24))
* **metrics:** beta release ([#25](https://github.com/awslabs/aws-lambda-powertools-python/issues/25))
* **metrics:** beta release ([#25](https://github.com/awslabs/aws-lambda-powertools-python/issues/25))
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "0.0.0",
"version": "0.1.0-beta.9",
"npmClient": "npm"
}
Loading