Skip to content

Commit d809899

Browse files
feat: migrate to semantic-release
1 parent e63ed0e commit d809899

File tree

80 files changed

+4888
-61551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4888
-61551
lines changed

.releaserc

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "test",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
[
11+
"@semantic-release/commit-analyzer",
12+
{
13+
"releaseRules": [
14+
{
15+
"type": "build",
16+
"scope": "deps",
17+
"release": "patch"
18+
},
19+
{
20+
"type": "docs",
21+
"scope": "README",
22+
"release": "patch"
23+
}
24+
]
25+
}
26+
],
27+
[
28+
"@semantic-release/release-notes-generator",
29+
{
30+
"preset": "conventionalCommits",
31+
"presetConfig": {
32+
"types": [
33+
{
34+
"type": "feat",
35+
"section": "Features"
36+
},
37+
{
38+
"type": "feature",
39+
"section": "Features"
40+
},
41+
{
42+
"type": "fix",
43+
"section": "Bug Fixes"
44+
},
45+
{
46+
"type": "perf",
47+
"section": "Performance Improvements"
48+
},
49+
{
50+
"type": "revert",
51+
"section": "Reverts"
52+
},
53+
{
54+
"type": "docs",
55+
"scope": "README",
56+
"section": "Documentation"
57+
},
58+
{
59+
"type": "build",
60+
"scope": "deps",
61+
"section": "Build System"
62+
},
63+
{
64+
"type": "docs",
65+
"section": "Documentation",
66+
"hidden": true
67+
},
68+
{
69+
"type": "style",
70+
"section": "Styles",
71+
"hidden": true
72+
},
73+
{
74+
"type": "chore",
75+
"section": "Miscellaneous Chores",
76+
"hidden": true
77+
},
78+
{
79+
"type": "refactor",
80+
"section": "Code Refactoring",
81+
"hidden": true
82+
},
83+
{
84+
"type": "test",
85+
"section": "Tests",
86+
"hidden": true
87+
},
88+
{
89+
"type": "build",
90+
"section": "Build System",
91+
"hidden": true
92+
},
93+
{
94+
"type": "ci",
95+
"section": "Continuous Integration",
96+
"hidden": true
97+
}
98+
]
99+
}
100+
}
101+
],
102+
"@semantic-release/changelog",
103+
"@semantic-release/npm",
104+
[
105+
"@semantic-release/exec",
106+
{
107+
"prepareCmd": "yarn build",
108+
"publishCmd": "./scripts/preparePackage.sh"
109+
}
110+
],
111+
[
112+
"@semantic-release/git",
113+
{
114+
"assets": [
115+
"CHANGELOG.md",
116+
"package.json"
117+
]
118+
}
119+
],
120+
[
121+
"@semantic-release/github",
122+
{
123+
"assets": [
124+
{
125+
"path": "package.zip"
126+
}
127+
]
128+
}
129+
]
130+
]
131+
}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For proposing changes, use the standard [pull request approach](https://docs.git
2727
aws lambda update-function-code --function-name <LAMBDA_FUNCTION_NAME> --region <AWS_REGION> --zip-file file://lambda.zip --publish
2828
```
2929

30-
You can invoke the function from your local environment using the [Invoke command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) in the AWS CLI, for example `aws lambda invoke --function-name <LAMBDA_FUNCTION_NAME> --region <AWS_REGION> --invocation-type RequestResponse --payload <EVENT_JSON>`, where the `<EVENT_JSON>` is the JSON you want to provide to your Lambda function as input. See [examples of events here](test/lambda).
30+
You can invoke the function from your local environment using the [Invoke command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) in the AWS CLI, for example `aws lambda invoke --function-name <LAMBDA_FUNCTION_NAME> --region <AWS_REGION> --invocation-type RequestResponse --payload <EVENT_JSON>`, where the `<EVENT_JSON>` is the JSON you want to provide to your Lambda function as input. See [examples of events here](proxy/test/lambda).
3131

3232
To deploy your function to your CloudFront distribution follow the [Cloudfront Developer Guide](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-edge-how-it-works-tutorial.html#lambda-edge-how-it-works-tutorial-add-trigger).
3333

@@ -58,4 +58,4 @@ The workflow `release.yml` is responsible for releasing a new version. It has to
5858

5959
### How to keep your worker up-to-date
6060

61-
CloudFront Integration by Fingerprint always uses the latest stable version for the customers and upgrades customer Lambda@Edge automatically by running CodePipeline once a new version of Lambda@Edge function is available on the public [S3 bucket](s3://fingerprint-pro-cloudfront-integration-lambda-function/release/lambda_latest.zip). The serverless application that contains the CodePipeline is responsible for delivering new updates from the S3 bucket to the customer's infrastructure.
61+
CloudFront Integration by Fingerprint always uses the latest stable version for the customers and upgrades customer Lambda@Edge automatically by running CodePipeline once a new version of Lambda@Edge function is available on the public [S3 bucket](s3://fingerprint-pro-cloudfront-integration-lambda-function/release/lambda_latest.zip). The serverless application that contains the CodePipeline is responsible for delivering new updates from the S3 bucket to the customer's infrastructure.

buildspec.release-lambda.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,43 @@ version: 0.2
33
phases:
44
build:
55
commands:
6-
- echo $CODEBUILD_RESOLVED_SOURCE_VERSION
6+
- node scripts/downloadGithubRelease.mjs
7+
- unzip package.zip -d dist
8+
- cd dist
9+
10+
- zip -r latest.zip fingerprintjs-pro-cloudfront-lambda-function.js
11+
- zip -r latest_mgmt.zip fingerprintjs-pro-cloudfront-mgmt-lambda-function.js
12+
13+
- aws s3api get-object --bucket fingerprint-pro-cloudfront-integration-lambda-function --key release/lambda_latest.zip previous.zip
14+
- aws s3api get-object --bucket fingerprint-pro-cloudfront-integration-lambda-function --key release/mgmt_lambda_latest.zip previous_mgmt.zip
15+
16+
- unzip previous.zip -d previous
17+
- unzip previous_mgmt.zip -d previous_mgmt
18+
19+
- diff previous/fingerprintjs-pro-cloudfront-lambda-function.js fingerprintjs-pro-cloudfront-lambda-function.js; diffStatus=$?
20+
- diff previous_mgmt/fingerprintjs-pro-cloudfront-mgmt-lambda-function.js fingerprintjs-pro-cloudfront-mgmt-lambda-function.js; mgmtDiffStatus=$?
21+
22+
- echo $diffStatus
23+
- echo $mgmtDiffStatus
24+
25+
- >-
26+
if [ $diffStatus -eq 0 ]; then
27+
echo "Files are the same. Don't need to upload the file."
28+
elif [ $diffStatus -eq 1 ]; then
29+
echo "Files are different. Uploading new version."
30+
#TODO uncomment
31+
#aws s3api put-object --body latest.zip --bucket fingerprint-pro-cloudfront-integration-lambda-function --key release/lambda_latest.zip
32+
else
33+
echo "There was something wrong with the diff command."
34+
fi
35+
36+
- >-
37+
if [ $mgmtDiffStatus -eq 0 ]; then
38+
echo "Files are the same. Don't need to upload the file."
39+
elif [ $mgmtDiffStatus -eq 1 ]; then
40+
echo "Files are different. Uploading new version."
41+
#TODO uncomment
42+
#aws s3api put-object --body latest_mgmt.zip --bucket fingerprint-pro-cloudfront-integration-lambda-function --key release/mgmt_lambda_latest.zip
43+
else
44+
echo "There was something wrong with the diff command."
45+
fi

buildspec.release-mgmt.yml

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

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] }

dist/fingerprintjs-pro-cloudfront-lambda-function.d.ts

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

0 commit comments

Comments
 (0)