Skip to content

Commit

Permalink
Merge pull request #2 from StasTserk/circleci-automated-release
Browse files Browse the repository at this point in the history
CircleCI workflow changes for automated releases
  • Loading branch information
StasTserk committed Jun 6, 2020
2 parents bd27086 + 7a9a08d commit c9e9179
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 8 deletions.
36 changes: 35 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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+$/
14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -91,4 +102,5 @@ exports.css = buildCss;
exports.yml = buildYml;
exports.deploy = deploy;

exports.watch = watch
exports.watch = watch;
exports.uv = version;
179 changes: 179 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 @@ -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",
Expand Down
17 changes: 11 additions & 6 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit c9e9179

Please sign in to comment.