From ebb2af87906b287f192ec845b74b7f4b62eb938b Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 13 May 2021 13:25:03 +0200 Subject: [PATCH] Automatically tag releases --- Models/Constants.ts | 2 +- Utils.ts | 2 -- package.json | 3 ++- scripts/printVersion.ts | 5 +++++ 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 scripts/printVersion.ts diff --git a/Models/Constants.ts b/Models/Constants.ts index 9b9c66f594..82df83bd80 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.7.2b"; + public static vNumber = "0.7.2c"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/Utils.ts b/Utils.ts index 96d659af50..209a020718 100644 --- a/Utils.ts +++ b/Utils.ts @@ -1,5 +1,3 @@ -import * as $ from "jquery" -import {type} from "os"; import * as colors from "./assets/colors.json" export class Utils { diff --git a/package.json b/package.json index a4d051b520..1efc82d725 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "prepare-deploy": "npm run generate && npm run test && npm run generate:editor-layer-index && npm run generate:layeroverview && npm run generate:layouts && npm run build && rm -rf .cache && npm run generate:docs", "deploy:staging": "npm run prepare-deploy && rm -rf /home/pietervdvn/git/pietervdvn.github.io/Staging/* && cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/Staging/ && cd /home/pietervdvn/git/pietervdvn.github.io/ && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", "deploy:pietervdvn": "cd /home/pietervdvn/git/pietervdvn.github.io/ && git pull && cd - && npm run prepare-deploy && rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/* && cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ && cd /home/pietervdvn/git/pietervdvn.github.io/ && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", - "deploy:production": "cd /home/pietervdvn/git/pietervdvn.github.io/ && git pull && cd - && rm -rf ./assets/generated && npm run prepare-deploy && npm run optimize-images && rm -rf /home/pietervdvn/git/mapcomplete.github.io/* && cp -r dist/* /home/pietervdvn/git/mapcomplete.github.io/ && cd /home/pietervdvn/git/mapcomplete.github.io/ && echo \"mapcomplete.osm.be\" > CNAME && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", + "deploy:production": "cd /home/pietervdvn/git/pietervdvn.github.io/ && git pull && cd - && rm -rf ./assets/generated && npm run prepare-deploy && npm run optimize-images && rm -rf /home/pietervdvn/git/mapcomplete.github.io/* && cp -r dist/* /home/pietervdvn/git/mapcomplete.github.io/ && cd /home/pietervdvn/git/mapcomplete.github.io/ && echo \"mapcomplete.osm.be\" > CNAME && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean && npm run gittag", + "gittag": "ts-node scripts/printVersion.ts | bash", "lint": "tslint --project . -c tslint.json '**.ts' ", "clean": "rm -rf .cache/ && (find *.html | grep -v \"\\(index\\|land\\|test\\|preferences\\|customGenerator\\).html\" | xargs rm) && rm *.webmanifest" }, diff --git a/scripts/printVersion.ts b/scripts/printVersion.ts new file mode 100644 index 0000000000..bdfadb570f --- /dev/null +++ b/scripts/printVersion.ts @@ -0,0 +1,5 @@ +import {Utils} from "../Utils"; +Utils.runningFromConsole = true; +import Constants from "../Models/Constants"; + +console.log("git tag -a", Constants.vNumber,`-m "Deployed on ${new Date()}"`) \ No newline at end of file