From 0fc846ab471b72852404d769022e6d9a9296f1e8 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 27 May 2019 00:46:13 +0200 Subject: [PATCH] release process with release-it --- LICENSE | 4 ++-- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- package.json | 29 ++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index bfe5887..7205464 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Matthias Kretschmann +Copyright (c) 2019 Matthias Kretschmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 88c908b..3d646eb 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ - [Development](#development) - [Configuration](#configuration) - [Build packages](#build-packages) +- [Creating Releases](#creating-releases) - [License](#license) --- @@ -100,6 +101,46 @@ On a Mac and Linux machine, packaging requires [`wine`](https://www.winehq.org) brew install wine rpm ``` +## Creating Releases + +From a clean `master` branch, running any release task will do the following: + +- bumps the project version +- creates a Git tag +- commits and pushes everything +- creates a GitHub release with commit messages as description +- adds freshly build binaries for macOS, Windows & Linux as assets to each GitHub release + +You can execute the script using {major|minor|patch} as first argument to bump the version accordingly: + +- To bump a patch version: `npm run release` +- To bump a minor version: `npm run release minor` +- To bump a major version: `npm run release major` + +For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases) + ## License -[The MIT License](./LICENSE) +```text +The MIT License (MIT) + +Copyright (c) 2019 Matthias Kretschmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +``` diff --git a/package.json b/package.json index b02b7af..28415d3 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "start": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js", "build": "webpack --mode production --config webpack.common.config.js", "package": "electron-builder build -mwl && open ./dist", - "dist": "npm run build && npm run package" + "dist": "npm run build && npm run package", + "release": "release-it --non-interactive" }, "repository": "https://github.com/kremalicious/blowfish.git", "homepage": "https://github.com/kremalicious/blowfish", @@ -52,6 +53,7 @@ "react-blockies": "^1.4.1", "react-dom": "^16.8.6", "react-pose": "^4.0.8", + "release-it": "^12.2.1", "style-loader": "^0.23.1", "stylelint": "^10.0.1", "stylelint-config-standard": "^18.3.0", @@ -80,5 +82,30 @@ ], "category": "Office" } + }, + "release-it": { + "scripts": { + "beforeStart": "npm test", + "afterBump": "npm run dist", + "afterRelease": "echo Successfully released ${name} v${version} to ${repo.repository}." + }, + "git": { + "tagName": "v${version}" + }, + "github": { + "release": true, + "assets": [ + "dist/*${version}*.exe", + "dist/*${version}-mac.zip", + "dist/*${version}.dmg", + "dist/*${version}.AppImage", + "dist/*${version}*.deb", + "dist/*${version}*.snap", + "dist/*${version}*.rpm" + ] + }, + "npm": { + "publish": false + } } }