Skip to content

Commit 8bd4e1e

Browse files
authored
chore: add release PR flow (#100)
1 parent 8b7966a commit 8bd4e1e

File tree

5 files changed

+24
-77
lines changed

5 files changed

+24
-77
lines changed

.github/workflows/release-please.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: release-please
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: GoogleCloudPlatform/release-please-action@v2
11+
with:
12+
token: ${{ secrets.GITHUB_TOKEN }}
13+
release-type: node
14+
package-name: '@netlify/netlify-cms-widget-parent'

CONTRIBUTING.md

+6-16
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,12 @@ yarn
1616
yarn build
1717
```
1818

19-
## Release
19+
## Releasing
2020

21-
Make sure you have npm + git credentials set up.
22-
23-
- [ ] Make changes and/or merge PRs.
24-
- [ ] `git checkout master`
25-
- [ ] `git pull`
26-
- [ ] `yarn`
27-
- [ ] Set up semantic release environment variables:
28-
29-
```bash
30-
export GIT_AUTHOR_NAME=<your-github-login>
31-
export GIT_AUTHOR_EMAIL=<your-github-email>
32-
export GIT_COMMITTER_NAME=<your-github-login>
33-
export GIT_COMMITTER_EMAIL=<your-github-email>
34-
export GITHUB_TOKEN=<github-token-with-public_repo-permissions>
35-
```
21+
1. Merge the release PR
22+
2. Switch to the default branch `git checkout master`
23+
3. Pull latest changes `git pull`
24+
4. `yarn`
25+
5. Publish the package `npm publish`
3626

3727
- [ ] `npm run release`

package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
"description": "A Netlify CMS widget to select directory parent for an entry",
55
"main": "dist/netlify-cms-widget-parent.js",
66
"scripts": {
7+
"prepublishOnly": "run-s build",
78
"build": "webpack --env.production",
89
"develop": "webpack-dev-server --env.development",
910
"lint": "eslint 'src/**/*.js'",
1011
"test": "jest",
1112
"format": "prettier --write 'src/**/*.js'",
12-
"format:ci": "prettier --check 'src/**/*.js'",
13-
"semantic-release": "cross-env CI=true HUSKY_SKIP_HOOKS=1 semantic-release",
14-
"release": "run-s build semantic-release && npm publish"
13+
"format:ci": "prettier --check 'src/**/*.js'"
1514
},
1615
"files": [
1716
"dist/"
@@ -47,8 +46,6 @@
4746
"@babel/preset-react": "^7.10.4",
4847
"@commitlint/cli": "^11.0.0",
4948
"@commitlint/config-conventional": "^11.0.0",
50-
"@semantic-release/changelog": "^5.0.1",
51-
"@semantic-release/git": "^9.0.0",
5249
"babel-loader": "^8.1.0",
5350
"babel-plugin-emotion": "^10.0.33",
5451
"copy-webpack-plugin": "^6.0.3",

release.config.js

-22
This file was deleted.

yarn.lock

+2-34
Original file line numberDiff line numberDiff line change
@@ -1491,16 +1491,6 @@
14911491
"@octokit/openapi-types" "^2.0.0"
14921492
"@types/node" ">= 8"
14931493

1494-
"@semantic-release/changelog@^5.0.1":
1495-
version "5.0.1"
1496-
resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-5.0.1.tgz#50a84b63e5d391b7debfe021421589fa2bcdafe4"
1497-
integrity sha512-unvqHo5jk4dvAf2nZ3aw4imrlwQ2I50eVVvq9D47Qc3R+keNqepx1vDYwkjF8guFXnOYaYcR28yrZWno1hFbiw==
1498-
dependencies:
1499-
"@semantic-release/error" "^2.1.0"
1500-
aggregate-error "^3.0.0"
1501-
fs-extra "^9.0.0"
1502-
lodash "^4.17.4"
1503-
15041494
"@semantic-release/commit-analyzer@^8.0.0":
15051495
version "8.0.1"
15061496
resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-8.0.1.tgz#5d2a37cd5a3312da0e3ac05b1ca348bf60b90bca"
@@ -1514,25 +1504,11 @@
15141504
lodash "^4.17.4"
15151505
micromatch "^4.0.2"
15161506

1517-
"@semantic-release/error@^2.1.0", "@semantic-release/error@^2.2.0":
1507+
"@semantic-release/error@^2.2.0":
15181508
version "2.2.0"
15191509
resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-2.2.0.tgz#ee9d5a09c9969eade1ec864776aeda5c5cddbbf0"
15201510
integrity sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==
15211511

1522-
"@semantic-release/git@^9.0.0":
1523-
version "9.0.0"
1524-
resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-9.0.0.tgz#304c4883c87d095b1faaae93300f1f1e0466e9a5"
1525-
integrity sha512-AZ4Zha5NAPAciIJH3ipzw/WU9qLAn8ENaoVAhD6srRPxTpTzuV3NhNh14rcAo8Paj9dO+5u4rTKcpetOBluYVw==
1526-
dependencies:
1527-
"@semantic-release/error" "^2.1.0"
1528-
aggregate-error "^3.0.0"
1529-
debug "^4.0.0"
1530-
dir-glob "^3.0.0"
1531-
execa "^4.0.0"
1532-
lodash "^4.17.4"
1533-
micromatch "^4.0.0"
1534-
p-reduce "^2.0.0"
1535-
15361512
"@semantic-release/github@^7.0.0":
15371513
version "7.2.0"
15381514
resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-7.2.0.tgz#925f3efd91adabfc4bbe0de24b79fe1a8a38b4e2"
@@ -7364,7 +7340,7 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4:
73647340
snapdragon "^0.8.1"
73657341
to-regex "^3.0.2"
73667342

7367-
micromatch@^4.0.0, micromatch@^4.0.2:
7343+
micromatch@^4.0.2:
73687344
version "4.0.2"
73697345
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
73707346
integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==
@@ -7961,7 +7937,6 @@ npm@^6.14.8:
79617937
cmd-shim "^3.0.3"
79627938
columnify "~1.5.4"
79637939
config-chain "^1.1.12"
7964-
debuglog "*"
79657940
detect-indent "~5.0.0"
79667941
detect-newline "^2.1.0"
79677942
dezalgo "~1.0.3"
@@ -7976,7 +7951,6 @@ npm@^6.14.8:
79767951
has-unicode "~2.0.1"
79777952
hosted-git-info "^2.8.8"
79787953
iferr "^1.0.2"
7979-
imurmurhash "*"
79807954
infer-owner "^1.0.4"
79817955
inflight "~1.0.6"
79827956
inherits "^2.0.4"
@@ -7995,14 +7969,8 @@ npm@^6.14.8:
79957969
libnpx "^10.2.4"
79967970
lock-verify "^2.1.0"
79977971
lockfile "^1.0.4"
7998-
lodash._baseindexof "*"
79997972
lodash._baseuniq "~4.6.0"
8000-
lodash._bindcallback "*"
8001-
lodash._cacheindexof "*"
8002-
lodash._createcache "*"
8003-
lodash._getnative "*"
80047973
lodash.clonedeep "~4.5.0"
8005-
lodash.restparam "*"
80067974
lodash.union "~4.6.0"
80077975
lodash.uniq "~4.5.0"
80087976
lodash.without "~4.4.0"

0 commit comments

Comments
 (0)