Skip to content

Commit

Permalink
feat(release) Generate checksum of the rum enhancer on release
Browse files Browse the repository at this point in the history
Fixes: adobe#282
  • Loading branch information
bosschaert committed Sep 18, 2024
1 parent 0dd3ab6 commit a8b7cc4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .releaserc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ module.exports = {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {}]
["@semantic-release/github", {
"assets": [
{
"path": "dist/index.js",
"label": "RUM Enhancer JS"
},
{
"path": "dist/index.md5",
"label": "RUM Enhancer Hash"
}
]
}]
],
branches: ['main'],
};
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"mocha-multi-reporters": "1.5.1",
"rollup": "4.21.2",
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-checksum": "1.0.1",
"rollup-plugin-eslint-bundle": "9.0.0",
"semantic-release": "24.1.0",
"web-vitals": "4.2.3"
Expand Down
9 changes: 8 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

import cleanup from 'rollup-plugin-cleanup';
import eslint from 'rollup-plugin-eslint-bundle';
import pkg from 'rollup-plugin-checksum';

const checksum = pkg.default;

const banner = `/*
* Copyright 2024 Adobe. All rights reserved.
Expand All @@ -31,7 +34,7 @@ const banner = `/*
const bundles = [
{
source: 'modules/index.js',
outputFile: 'src/index',
outputFile: 'dist/index',
},
];

Expand Down Expand Up @@ -63,5 +66,9 @@ export default [...bundles.map(({ outputFile, source }) => ({
fix: true,
},
}),
checksum({
filename: `${outputFile.split('/').pop()}.md5`,
includeAssets: false,
}),
],
}))];

0 comments on commit a8b7cc4

Please sign in to comment.