Skip to content

Commit 8e95711

Browse files
committed
chore(release): use semantic-release
1 parent 4b98e6b commit 8e95711

File tree

4 files changed

+112
-13
lines changed

4 files changed

+112
-13
lines changed

.circleci/circle.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 2
2+
3+
aliases:
4+
- &restore-cache
5+
keys:
6+
- dependency-cache-{{ checksum "package.json" }}
7+
8+
- &save-cache
9+
key: dependency-cache-{{ checksum "package.json" }}
10+
paths:
11+
- node_modules
12+
13+
defaults: &defaults
14+
docker:
15+
- image: circleci/node:latest
16+
working_directory: /tmp/workspace
17+
18+
jobs:
19+
build:
20+
<<: *defaults
21+
steps:
22+
- checkout
23+
- restore_cache: *restore-cache
24+
- run: npm install
25+
- save_cache: *save-cache
26+
- persist_to_workspace:
27+
root: /tmp/workspace
28+
paths:
29+
- "*"
30+
31+
deploy:
32+
<<: *defaults
33+
environment:
34+
GIT_AUTHOR_NAME: Ionitron
35+
GIT_AUTHOR_EMAIL: [email protected]
36+
GIT_COMMITTER_NAME: Ionitron
37+
GIT_COMMITTER_EMAIL: [email protected]
38+
steps:
39+
- add_ssh_keys:
40+
fingerprints:
41+
- "ae:6d:3a:f1:cf:39:e1:94:6e:22:2a:9f:54:f9:b0:1b" # ionitron user key
42+
- checkout
43+
- attach_workspace:
44+
at: /tmp/workspace
45+
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
46+
- run: npm run publish:ci -- --yes
47+
48+
49+
workflows:
50+
version: 2
51+
build:
52+
jobs:
53+
- build
54+
- deploy:
55+
requires: [build]
56+
filters:
57+
branches:
58+
only: stable

CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ Please familiarize yourself with [Cordova plugin development](https://cordova.ap
1616

1717
You can use `cordova plugin add` with a local directory to copy and compile plugin changes into a test project.
1818

19-
### Pull Requests
19+
### Workflow
2020

21-
Please create a pull request for the `master` branch.
21+
This repo uses [semantic-release](https://github.com/semantic-release/semantic-release), so it's important to follow a strict workflow to ensure properly automated releases.
2222

23-
## Publishing
23+
* Work off of `master` branch (create new branch or fork)
24+
* Make changes
25+
* Use `npm run cz` (or `git cz` if [commitizen](https://github.com/commitizen/cz-cli) is installed globally) to make commits
26+
* Create a pull request
27+
* Pull requests will be approved and squashed into the `master` branch
28+
* Try to make pull requests with a single objective (don't have multiple features in one PR, don't mix fixes and features in one PR, etc.)
2429

25-
1. Add changes to `CHANGELOG.md`.
26-
1. Deploy:
30+
### Publishing
2731

28-
```
29-
npm run deploy -- <version>
30-
```
32+
Releases are automated in CI using [semantic-release](https://github.com/semantic-release/semantic-release) when the `stable` branch is pushed to Github. Rebase `master` with `stable`. Commits in `master` should be appropriately formatted from the PR workflow (see [Workflow](#workflow)).

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
<!-- TODO: remove beta in README.md and CONTRIBUTING.md -->
2121

22+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
23+
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&identifier=104773211)](https://dependabot.com)
24+
[![npm](https://img.shields.io/npm/v/cordova-plugin-ionic-webview.svg)](https://www.npmjs.com/package/cordova-plugin-ionic-webview)
25+
2226
# Ionic Web View for Cordova
2327

2428
A Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).

package.json

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"sync_plugin_xml": "sync-cordova-xml package.json plugin.xml --output=plugin.xml",
88
"version": "npm run sync_plugin_xml && git add plugin.xml",
9-
"deploy": "np"
9+
"cz": "git-cz"
1010
},
1111
"repository": {
1212
"type": "git",
@@ -21,16 +21,51 @@
2121
],
2222
"author": "Ionic Team",
2323
"license": "Apache-2.0",
24-
"devDependencies": {
25-
"np": "^3.0.4",
26-
"sync-cordova-xml": "^0.4.0"
27-
},
2824
"engines": {
2925
"cordovaDependencies": {
3026
"2.0.0": {
3127
"cordova-android": ">=6.4.0",
3228
"cordova-ios": ">=4.0.0-dev"
3329
}
3430
}
31+
},
32+
"devDependencies": {
33+
"@semantic-release/changelog": "^3.0.0",
34+
"@semantic-release/git": "^7.0.4",
35+
"@semantic-release/github": "^5.0.6",
36+
"@semantic-release/npm": "^5.0.4",
37+
"commitizen": "^3.0.2",
38+
"cz-conventional-changelog": "^2.1.0",
39+
"semantic-release": "^15.9.17",
40+
"sync-cordova-xml": "^0.4.0"
41+
},
42+
"release": {
43+
"branch": "stable",
44+
"verifyConditions": [
45+
"@semantic-release/changelog",
46+
"@semantic-release/npm",
47+
"@semantic-release/github",
48+
"@semantic-release/git"
49+
],
50+
"prepare": [
51+
"@semantic-release/changelog",
52+
"@semantic-release/npm",
53+
"@semantic-release/git"
54+
],
55+
"publish": [
56+
"@semantic-release/github",
57+
"@semantic-release/npm"
58+
],
59+
"success": [
60+
"@semantic-release/github"
61+
],
62+
"fail": [
63+
"@semantic-release/github"
64+
]
65+
},
66+
"config": {
67+
"commitizen": {
68+
"path": "./node_modules/cz-conventional-changelog"
69+
}
3570
}
3671
}

0 commit comments

Comments
 (0)