diff --git a/CHANGELOG.md b/CHANGELOG.md index 44851699..de36a069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.28.0] - 2021-03-19 + +## Fixed + +- Package was missing LICENSE + ## [1.27.0] - 2021-03-04 ## Added diff --git a/gulpfile.js b/gulpfile.js index 44978ff6..aa62c132 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -35,6 +35,7 @@ gulp.task('build:package', gulp.series( 'js:compile-all-govuk-and-hmrc', 'update-assets-version', 'copy:README', + 'copy:LICENSE', 'copy:packageJson', )); diff --git a/package.json b/package.json index 3c119228..feb8b485 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hmrc-frontend", - "version": "1.27.0", + "version": "1.28.0", "description": "Design patterns for HMRC frontends", "scripts": { "start": "gulp dev", diff --git a/tasks/gulp/__tests__/after-build-package.test.js b/tasks/gulp/__tests__/after-build-package.test.js index 91524ad8..7070f6b8 100644 --- a/tasks/gulp/__tests__/after-build-package.test.js +++ b/tasks/gulp/__tests__/after-build-package.test.js @@ -46,6 +46,7 @@ describe('package/', () => { 'govuk-prototype-kit.config.json', 'package.json', 'README.md', + 'LICENSE', 'hmrc/govuk/fonts/bold-affa96571d-v2.woff', 'hmrc/govuk/fonts/bold-b542beb274-v2.woff2', 'hmrc/govuk/fonts/light-94a07e06a1-v2.woff2', @@ -104,6 +105,16 @@ describe('package/', () => { })); }); + describe('LICENSE', () => { + it('is added', () => readFile(path.join(configPaths.package, 'LICENSE'), 'utf8') + .then((contents) => { + // Look for H1 matching 'GOV.UK Frontend' from existing README + expect(contents).toMatch(/^ {33}Apache License/); + }).catch((error) => { + throw error; + })); + }); + describe('all.scss', () => { const govukLink = path.join(configPaths.packageTest, 'govuk-frontend'); const hmrcLink = path.join(configPaths.packageTest, 'hmrc-frontend'); diff --git a/tasks/gulp/package.js b/tasks/gulp/package.js index c0bd4d8a..78888443 100644 --- a/tasks/gulp/package.js +++ b/tasks/gulp/package.js @@ -14,6 +14,10 @@ gulp.task('copy:README', () => gulp .src(`${configPaths.src}../README.md`) .pipe(gulp.dest(configPaths.package))); +gulp.task('copy:LICENSE', () => gulp + .src(`${configPaths.src}../LICENSE`) + .pipe(gulp.dest(configPaths.package))); + gulp.task('copy:packageJson', (done) => { const requiredKeys = [ 'name', @@ -28,6 +32,7 @@ gulp.task('copy:packageJson', (done) => { 'homepage', 'dependencies', 'scripts', + 'license', ]; Object.keys(packageFile).forEach((key) => {