mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Yeoman package builder emits .tar.gz artifact
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
"lodash": "^4.11.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"rimraf": "^2.5.2",
|
||||
"semver": "^5.3.0"
|
||||
"semver": "^5.3.0",
|
||||
"tar.gz": "^1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^5.0.30",
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as _ from 'lodash';
|
||||
import * as mkdirp from 'mkdirp';
|
||||
import * as rimraf from 'rimraf';
|
||||
import * as childProcess from 'child_process';
|
||||
import * as targz from 'tar.gz';
|
||||
|
||||
const isWindows = /^win/.test(process.platform);
|
||||
const textFileExtensions = ['.gitignore', 'template_gitignore', '.config', '.cs', '.cshtml', '.csproj', 'Dockerfile', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx', '.xproj'];
|
||||
@@ -81,8 +82,7 @@ function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string)
|
||||
});
|
||||
}
|
||||
|
||||
function buildYeomanNpmPackage() {
|
||||
const outputRoot = './dist/generator-aspnetcore-spa';
|
||||
function buildYeomanNpmPackage(outputRoot: string) {
|
||||
const outputTemplatesRoot = path.join(outputRoot, 'app/templates');
|
||||
rimraf.sync(outputTemplatesRoot);
|
||||
|
||||
@@ -190,7 +190,19 @@ function runScripts(rootDir: string, scripts: string[]) {
|
||||
console.log(`[Prepublish] Done`)
|
||||
}
|
||||
|
||||
rimraf.sync('./dist');
|
||||
const distDir = './dist';
|
||||
const artifactsDir = path.join(distDir, 'artifacts');
|
||||
const yeomanOutputRoot = path.join(distDir, 'generator-aspnetcore-spa');
|
||||
|
||||
rimraf.sync(distDir);
|
||||
mkdirp.sync(artifactsDir);
|
||||
runAllPrepublishScripts();
|
||||
buildYeomanNpmPackage();
|
||||
buildYeomanNpmPackage(yeomanOutputRoot);
|
||||
buildDotNetNewNuGetPackage();
|
||||
|
||||
// Finally, create a .tar.gz file containing the built generator-aspnetcore-spa.
|
||||
// The CI system can treat this as the final built artifact.
|
||||
// Note that the targz APIs only come in async flavor.
|
||||
targz().compress(yeomanOutputRoot, path.join(artifactsDir, 'generator-aspnetcore-spa.tar.gz'), err => {
|
||||
if (err) { throw err; }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user