* Publish With Yarn

* test a theory
This commit is contained in:
Garrett Serack 2017-09-22 17:57:21 -07:00 коммит произвёл Johannes Bader
Родитель d037ace0dd
Коммит 555a2cd339
5 изменённых файлов: 33 добавлений и 19 удалений

7
.gitignore поставляемый
Просмотреть файл

@ -289,3 +289,10 @@ __pycache__/
package-lock.json package-lock.json
*.tgz *.tgz
yarn.lock
package/
*.tar
*.tgz
src/obj/
*.log

Просмотреть файл

@ -1,15 +1,9 @@
task 'publish-preview', '', ['version-number'] , (done) -> task 'publish-preview', '', ['version-number','build'] , (done) ->
package_path = "#{basefolder}/package.json" package_json = require "#{basefolder}/package.json"
package_folder = "#{basefolder}"
# 1. update the patch number
package_json = require package_path
package_json.version = version
JSON.stringify(package_json,null,' ').to package_path
# 2. call npm publish --tag preview
# Note : this will call the npm prepare task, which will call
execute "npm publish --tag preview",{cwd:package_folder, silent:false }, (c,o,e) ->
echo "\n\nPublished: #{package_json.name}@#{info package_json.version} (tagged as @preview)\n\n"
done()
# move .gitignore out of the way - yarn bug
rm "-f", "#{basefolder}/.gitignore"
execute "#{basefolder}/node_modules/.bin/yarn publish --tag preview --new-version #{version} --access public ",{cwd:basefolder, silent:false }, (c,o,e) ->
echo "\n\nPublished: #{package_json.name}@#{info version} (tagged as @preview)\n\n"
# bring back .gitignore!
execute "git checkout #{basefolder}/.gitignore",{cwd:basefolder, silent:true }, done

Просмотреть файл

@ -15,7 +15,7 @@ regenExpected = (opts,done) ->
swaggerFiles = (if optsMappingsValue instanceof Array then optsMappingsValue[0] else optsMappingsValue).split(";") swaggerFiles = (if optsMappingsValue instanceof Array then optsMappingsValue[0] else optsMappingsValue).split(";")
args = [ args = [
"--#{opts.language}", "--#{opts.language}",
"--clear-output-folder", # "--clear-output-folder", # run multiple times on same folders (API version nests)
"--output-folder=#{outputDir}/#{key}", "--output-folder=#{outputDir}/#{key}",
"--license-header=#{if !!opts.header then opts.header else 'MICROSOFT_MIT_NO_VERSION'}" "--license-header=#{if !!opts.header then opts.header else 'MICROSOFT_MIT_NO_VERSION'}"
] ]

Просмотреть файл

@ -1,7 +1,19 @@
.gulp/ .gulp/
.vscode/ .vscode/
src/Model/
src/Properties/
test/ test/
src/obj/
package/
*.tar
*.tgz
gulpfile.js gulpfile.js
*.sln *.sln
*.cs
*.resx
src/obj/ src/obj/
yarn.lock
*.log
*.csproj

Просмотреть файл

@ -45,7 +45,8 @@
"run-sequence": "*", "run-sequence": "*",
"shx": "^0.2.2", "shx": "^0.2.2",
"through2-parallel": "^0.1.3", "through2-parallel": "^0.1.3",
"yargs": "^8.0.2" "yargs": "^8.0.2",
"yarn": "^1.0.2"
}, },
"dependencies": { "dependencies": {
"dotnet-2.0.0": "^1.1.0" "dotnet-2.0.0": "^1.1.0"