From 6b4ae4a6a92ec148165593c0b7be6032c7a2029e Mon Sep 17 00:00:00 2001 From: Menno Finlay-Smits Date: Mon, 20 Aug 2018 14:06:17 +1200 Subject: [PATCH] Add support for releasing as a Debian package --- README.md | 14 ++++++++------ nfpm.yaml | 13 +++++++++++++ package.json | 4 +++- update-nfpm-version | 8 ++++++++ 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 nfpm.yaml create mode 100755 update-nfpm-version diff --git a/README.md b/README.md index 0ccdf8ce..3e1e567a 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,16 @@ For detailed explanation on how things work, consult the [docs for vue-loader](h Please follow the Vue style guide for all development: https://vuejs.org/v2/style-guide/#ad -# Production +# Production Releases -Create the distribution file -``` bash -npm run build -``` +* Ensure all changes have been merged and are pulled into the local copy. +* Update the version number and tag the new version with: `npm version ` +* Push the tag to Github: `git push origin ` +* Build the deb package: `nfpm pkg -t cacophony-web-vuex_.deb` +* Upload the resulting package to the [Github Releases](https://github.com/TheCacophonyProject/cacophony-web-vuex/releases) for cacophony-web-vuex -The index.html file in the root of the project should be served via a web server, an express example might look as follows: +The index.html file in the root of the distribution should be served +via a web server. An express example might look as follows: ```javascript const express = require('express'); diff --git a/nfpm.yaml b/nfpm.yaml new file mode 100644 index 00000000..a8a78155 --- /dev/null +++ b/nfpm.yaml @@ -0,0 +1,13 @@ +name: "cacophony-web-vuex" +arch: "amd64" +platform: "linux" +version: "0.0.0" +maintainer: "Cacophony Developers " +description: | + Web interface for the Cacophony Project API +vendor: "The Cacophony Project" +homepage: https://github.com/TheCacophonyProject +license: "GPLv3" +files: + ./index.html: "/srv/cacophony/cacophony-web-vuex/" + ./dist/*: "/srv/cacophony/cacophony-web-vuex/dist/" diff --git a/package.json b/package.json index 9124e1a6..fa333dcb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "test": "cross-env NODE_ENV=test jest", "test:watch": "cross-env NODE_ENV=test npm run test -- --watch", "lint": "eslint ./src --ext .js,.vue", - "lint-fix": "eslint ./src --fix --ext .js,.vue" + "lint-fix": "eslint ./src --fix --ext .js,.vue", + "preversion": "npm test", + "version": "./update-nfpm-version" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.1", diff --git a/update-nfpm-version b/update-nfpm-version new file mode 100755 index 00000000..99dc3183 --- /dev/null +++ b/update-nfpm-version @@ -0,0 +1,8 @@ +#!/bin/sh + +# This script writes the version number in $npm_package_version into +# the correct place in nfpm.yaml. It is called by a script target in +# packages.json. + +perl -pi -e "s/^version:.+/version: \"$npm_package_version\"/" nfpm.yaml +git add nfpm.yaml