Skip to content

Commit ced810a

Browse files
authored
chore(cicd): Add release workflow (#260)
1 parent 1b92a1e commit ced810a

18 files changed

+36647
-3534
lines changed

.github/workflows/on-pull-request.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/on-push.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: on-push-event
22
on:
3-
push
4-
3+
push:
4+
branches:
5+
- '**' # matches every branch
6+
- '!main'
57
jobs:
68
on_push:
79
runs-on: ubuntu-latest
8-
if: ${{ github.event_name != 'pull_request' }}
910
env:
1011
NODE_ENV: dev
1112
steps:
@@ -24,4 +25,24 @@ jobs:
2425
- name: Run lint
2526
run: npm run lerna-lint
2627
- name: Run tests
27-
run: npm run lerna-test
28+
run: npm run lerna-test
29+
- name: Collate Coverage Reports
30+
if: ${{ github.actor != 'dependabot[bot]' }}
31+
run: |
32+
for d in ./packages/*/ ; do
33+
mkdir -p coverage
34+
if [[ ! -f coverage/lcov.info ]]
35+
then
36+
continue
37+
fi
38+
filename="$d""coverage/lcov.info"
39+
targetSource="SF:""$d""src"
40+
sed "s|SF:src|$targetSource|g" $filename >> coverage/lcov.info
41+
done
42+
- name: Report Coverage
43+
#Dependabot user will only have read-only perms, so don't try to report coverage
44+
if: ${{ github.actor != 'dependabot[bot]' }}
45+
uses: romeovs/[email protected]
46+
with:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
48+
lcov-file: ./coverage/lcov.info

.github/workflows/on-release.yml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
1-
name: on-release-event
2-
1+
name: release
32
on:
4-
release:
5-
types: [created]
6-
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch: {}
77
jobs:
8-
build:
8+
publish:
99
runs-on: ubuntu-latest
10+
1011
steps:
11-
- uses: actions/checkout@v2
12-
- name: "Setup npm"
13-
run: |
14-
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
15-
- name: Install packages
16-
run: |
17-
export NODE_ENV=dev
18-
npm ci
19-
npm run lerna-ci
20-
- name: Run lint
21-
run: npm run lerna-lint
22-
- name: Run tests
23-
run: npm run lerna-test
24-
# TODO: add publish step
12+
- name: "Checkout"
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: "Use NodeJS 14"
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '14'
21+
22+
- name: "Setup npm"
23+
run: |
24+
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
25+
26+
- name: Install packages
27+
run: |
28+
npm ci
29+
npm run lerna-ci
30+
- name: Run lint
31+
run: npm run lerna-lint
32+
- name: Run tests
33+
run: npm run lerna-test
34+
- name: "Version and publish"
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
git config user.name "${{ github.actor }}"
39+
git config user.email "${{ github.actor}}@users.noreply.github.com"
40+
41+
if [ ${{ github.base_ref }} = main ]; then
42+
npx lerna version --conventional-commits --create-release github --yes
43+
else
44+
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --yes
45+
fi
46+
npx lerna publish from-git --no-verify-access --yes

CHANGELOG.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
# [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)
7+
8+
9+
### Bug Fixes
10+
11+
* **metrics:** lib entrypoint ([819098b](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/819098b9e820d0998b6116b659dd456ae65ba20a))
12+
13+
14+
15+
16+
17+
# [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)
18+
19+
**Note:** Version bump only for package aws-lambda-powertools-typescript
20+
21+
22+
23+
24+
25+
# 0.1.0-beta.7 (2021-12-15)
26+
27+
28+
### Bug Fixes
29+
30+
* **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))
31+
* **ci:** merge conflict ([97796df](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/97796df7cb7036396459279224d64bd277651e71))
32+
* **ci:** updated github actions commands ([76ba8c7](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/76ba8c76c33db5eba44a50c015880520f04bb54c))
33+
* **ci:** updated NPM dependencies (audit) ([3166c7b](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/3166c7b7c58baa8414121c73f15139f4db0ccf38))
34+
* hosted-git-info bump in logger ([fb2a365](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/fb2a365cc73ae60d6e32d46361265a5ee8f5cad1))
35+
* **logger:** jest set to next version as workaround for vulnerability ([0f423bf](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/0f423bf7479a28829e81fabc6c58ed4e76dcfda4))
36+
* **logging:** removed forgotten dummy folder ([a10791f](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/a10791f5201739ab2f5f7019bbc52ea04cb0d723))
37+
* **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))
38+
* upgrade of dependencies, npm-shrinkwrap for packages/logger ([c120c64](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/c120c64670ac3ed86438267c0a9c9fc72a3f7ebe))
39+
* version bumb for commitlint/cli ([0e1f6be](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/0e1f6be2786779ca43c3fcac6cb9e96431ca585d))
40+
41+
42+
### Features
43+
44+
* add metrics ([#102](https://github.com/awslabs/aws-lambda-powertools-typescript/issues/102)) ([cf22210](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/cf22210ebb519cf0a625a2bdc92d2bcea7b4a59d))
45+
* 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))
46+
* **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))
47+
* **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))
48+
* **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)
49+
* **logger:** lint error fixes ([5272ac0](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/5272ac0c12bbfe23395429f8a239f90ac8676b15))
50+
* **logging:** added basic lerna package for the logging module ([14c679d](https://github.com/awslabs/aws-lambda-powertools-typescript/commit/14c679da949cd4b4ef5cd076ce1a7da5132c3cde))
51+
52+
53+
54+
55+
156
# Changelog
257

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

1469
* **tracer:** beta release ([#91](https://github.com/awslabs/aws-lambda-powertools-python/issues/91))
1570
* **logger:** beta release ([#24](https://github.com/awslabs/aws-lambda-powertools-python/issues/24))
16-
* **metrics:** beta release ([#25](https://github.com/awslabs/aws-lambda-powertools-python/issues/25))
71+
* **metrics:** beta release ([#25](https://github.com/awslabs/aws-lambda-powertools-python/issues/25))

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.0.0",
5+
"version": "0.1.0-beta.9",
66
"npmClient": "npm"
77
}

0 commit comments

Comments
 (0)