Skip to content

Commit f9441e9

Browse files
authored
Merge pull request #288 from netlify/chore/release-please
chore: add release-please
2 parents 6d8e977 + f452ce9 commit f9441e9

File tree

5 files changed

+47
-71
lines changed

5 files changed

+47
-71
lines changed

.github/workflows/release-please.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
id: release
12+
with:
13+
# We can't rely on the GITHUB_TOKEN as we need to trigger
14+
# further actions and the GITHUB_TOKEN doesn't allow it
15+
token: ${{ secrets.NODE_PKG_RELEASE_TOKEN }}
16+
release-type: node
17+
package-name: '@netlify/open-api'

.github/workflows/swagger-bump.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: swagger-bump
2+
on:
3+
# Workaround for bumping the swagger.yml file on release-please PRs
4+
push:
5+
branches:
6+
- release-*
7+
jobs:
8+
swagger-bump:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
registry-url: 'https://registry.npmjs.org'
16+
- run: npm ci
17+
- run: npm version:1-swagger
18+
- uses: stefanzweifel/git-auto-commit-action@v4
19+
with:
20+
commit_message: "chore: bump swagger.yml file"

CONTRIBUTING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,18 @@ You may first want to edit swagger.yml to add your field or endpoint definitions
3232

3333
## Making PRs
3434

35-
1. Don't bump the version number for `swagger.yml` changes. Do that during the release process.
36-
2. Ensure `make validate` passes.
37-
3. The go tests run against the last generated go client. These must pass before making a release.
38-
4. If all you want is a new endpoint, you can PR just the `swagger.yml` changes for review and regenerate the go client when its ready to go in.
35+
1. Make sure your PR title and commits follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) spec.
36+
2. Don't bump the version number for `swagger.yml` changes. The release process handles that.
37+
3. Ensure `make validate` passes.
38+
4. The go tests run against the last generated go client. These must pass before making a release.
39+
5. If all you want is a new endpoint, you can PR just the `swagger.yml` changes for review and regenerate the go client when its ready to go in.
3940

4041
## Making a new release
4142

42-
1. Make sure you are on the HEAD of the master branch.
43-
2. regenarate go client (if you haven't) (Make all and commit the results)
44-
3. bump a JS package version with `npm version [major|minor|patch]` (updates package.json, swagger.yaml and create a git tag)
45-
4. Run `npm publish` which will as `git push && git push --tags` to push to the origin, create a github release and publish the spec to npm.
43+
1. Merge the release PR (auto generated via `release-please`).
44+
2. Switch to the default branch git checkout master.
45+
3. Pull latest changes git pull.
46+
4. Run `npm publish`.
4647

4748
## License
4849

package-lock.json

Lines changed: 0 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"devDependencies": {
1818
"analytics": "^0.2.0",
1919
"analytics-plugin-ga": "^0.1.5",
20-
"auto-changelog": "^1.16.1",
2120
"ava": "^2.4.0",
2221
"cp-file": "^7.0.0",
2322
"eslint": "^6.3.0",
@@ -58,8 +57,7 @@
5857
"convert": "node src/convert.js",
5958
"version": "run-s version:*",
6059
"version:1-swagger": "node src/bump-swagger.js",
61-
"version:2-changelog": "auto-changelog -p --template keepachangelog --breaking-pattern breaking",
62-
"version:3-git": "git add CHANGELOG.md swagger.yml",
60+
"version:2-git": "git add swagger.yml",
6361
"redoc": "node src/docs/build.js",
6462
"lint": "run-s eslint prettier",
6563
"eslint": "eslint --fix \"src/**/*.js\"",

0 commit comments

Comments
 (0)