diff --git a/.circleci/config.yml b/.circleci/config.yml index b853369b..2a78f292 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,41 @@ jobs: - run: npm install - run: sudo npm install -g gulp - run: gulp build + - run: mkdir ./artifacts + - persist_to_workspace: + root: ./ + paths: release/* + publish-github-release: + docker: + - image: cibuilds/github:0.10 + steps: + - attach_workspace: + at: ./ + - run: zip -r ./release${CIRCLE_TAG}.zip ./release + - store_artifacts: + path: ./ + - run: + name: "Publish Release on Github" + command: | + VERSION=${CIRCLE_TAG} + ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./release${CIRCLE_TAG}.zip workflows: build-and-test: jobs: - - build-and-test \ No newline at end of file + - build-and-test + publish-github-release: + jobs: + - build-and-test: + filters: + branches: + ignore: /.*/ + tags: + only: /^\d+\.\d+\.\d+$/ + - publish-github-release: + requires: + - build-and-test + filters: + branches: + ignore: /.*/ + tags: + only: /^\d+\.\d+\.\d+$/ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 403816e7..b442dc1d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,6 +5,7 @@ const ts = require("gulp-typescript"); const tsProject = ts.createProject("tsconfig.json"); const sass = require("gulp-sass"); sass.compiler = require("node-sass"); +const jsonModify = require("gulp-json-modify"); const fs = require("fs"); @@ -51,6 +52,16 @@ function buildYml() { .pipe(gulp.dest("./dist")); } +function version() { + const version = process.argv[4]; + const download = `https://github.com/StasTserk/foundry-burningwheel/releases/download/${version}/release${version}.zip` + + return gulp.src("./system.json") + .pipe(jsonModify({ key: "version", value: version })) + .pipe(jsonModify({ key: "download", value: download })) + .pipe(gulp.dest("./")); +} + const tsTask = gulp.series( lintTs, compileTs, @@ -91,4 +102,5 @@ exports.css = buildCss; exports.yml = buildYml; exports.deploy = deploy; -exports.watch = watch \ No newline at end of file +exports.watch = watch; +exports.uv = version; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 163e4e05..b8a8d405 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,6 +128,15 @@ "ansi-wrap": "^0.1.0" } }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, "ansi-escapes": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", @@ -151,6 +160,15 @@ "ansi-wrap": "0.1.0" } }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -920,6 +938,16 @@ "assert-plus": "^1.0.0" } }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "meow": "^3.3.0" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1051,6 +1079,16 @@ "esutils": "^2.0.2" } }, + "dot-object": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-1.9.0.tgz", + "integrity": "sha512-7MPN6y7XhAO4vM4eguj5+5HNKLjJYfkVG1ZR1Aput4Q4TR6SYeSjhpVQ77IzJHoSHffKbDxBC+48aCiiRurDPw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "glob": "^7.1.4" + } + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -1941,6 +1979,110 @@ "plugin-error": "^1.0.1" } }, + "gulp-json-modify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/gulp-json-modify/-/gulp-json-modify-1.0.2.tgz", + "integrity": "sha1-p1Qk8zR2W2LAyXjKa2UFxfvASXA=", + "dev": true, + "requires": { + "dot-object": "^1.2.0", + "plugin-error": "^0.1.2", + "plugin-log": "^0.1.0", + "through2": "^0.5.1" + }, + "dependencies": { + "arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" + } + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "dev": true, + "requires": { + "kind-of": "^1.1.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", + "dev": true + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "dev": true, + "requires": { + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", + "dev": true, + "requires": { + "readable-stream": "~1.0.17", + "xtend": "~3.0.0" + } + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", + "dev": true + } + } + }, "gulp-sass": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-4.1.0.tgz", @@ -3459,6 +3601,43 @@ "extend-shallow": "^3.0.2" } }, + "plugin-log": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/plugin-log/-/plugin-log-0.1.0.tgz", + "integrity": "sha1-hgSc9qsQgzOYqTHzaJy67nteEzM=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "dateformat": "^1.0.11" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", diff --git a/package.json b/package.json index 351f16fd..226fd7be 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "devDependencies": { "foundry-pc-types": "gitlab:foundry-projects/foundry-pc/foundry-pc-types", "gulp": "^4.0.2", + "gulp-json-modify": "^1.0.2", "gulp-sass": "^4.1.0", "gulp-tslint": "^8.1.4", "gulp-typescript": "^6.0.0-alpha.1", diff --git a/system.json b/system.json index d8f12a80..ca2afd92 100644 --- a/system.json +++ b/system.json @@ -2,19 +2,24 @@ "name": "burningwheel", "title": "Burning Wheel", "description": "Foundry implementation of The Burning Wheel", - "version": "0.0.1", + "version": "0.0.2", "templateVersion": 1, "author": "Stas Tserkovny", - "esmodules": ["module/burningwheel.js"], + "esmodules": [ + "module/burningwheel.js" + ], "scripts": [], - "styles": ["styles/burningwheel.css"], + "styles": [ + "styles/burningwheel.css" + ], "packs": [], "minimumCoreVersion": "0.6.0", + "compatibleCoreVersion": "0.6.1", "socket": false, "initiative": "1d20", "gridDistance": 10, "gridUnits": "ft", - "url": "http://www.google.com", - "manifest": "http://www.google.com", - "download": "http://www.google.com" + "url": "https://github.com/StasTserk/foundry-burningwheel", + "manifest": "https://raw.githubusercontent.com/StasTserk/foundry-burningwheel/master/system.json", + "download": "https://github.com/StasTserk/foundry-burningwheel/releases/download/0.0.2/release0.0.2.zip" } \ No newline at end of file