From 94283031513840f26e24bf0ed4464e2f8117e0af Mon Sep 17 00:00:00 2001 From: erezrokah Date: Wed, 10 Mar 2021 12:14:51 +0100 Subject: [PATCH 1/2] chore: add release please --- .github/workflows/release-please.yml | 14 ++++++++++++++ RELEASE.md | 4 ++++ commitlint.config.js | 1 + package.json | 8 +++++++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 RELEASE.md create mode 100644 commitlint.config.js diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000000..4e952f68e6 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,14 @@ +name: release-please +on: + push: + branches: + - main +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + token: ${{ secrets.NODE_PKG_RELEASE_TOKEN }} + release-type: node + package-name: '@netlify/plugin-nextjs' diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000000..205a9a3f68 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,4 @@ +# Releasing + +1. Merge the release PR +2. Run `npm publish` diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000000..4fedde6daf --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] } diff --git a/package.json b/package.json index 51a53517ef..74023e0d76 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,12 @@ "cypress:local": "env CYPRESS_DEPLOY=local cypress run --project ./src --config-file false --config video=false", "cypress:netlify": "env CYPRESS_DEPLOY=netlify cypress run --project ./src --config-file false --config video=false", "cypress:local:testonly": "env CYPRESS_SKIP_DEPLOY=true npm run cypress:local", - "cypress:netlify:testonly": "env CYPRESS_SKIP_DEPLOY=true npm run cypress:netlify" + "cypress:netlify:testonly": "env CYPRESS_SKIP_DEPLOY=true npm run cypress:netlify", + "prepublishOnly": "run-s prepublishOnly:*", + "prepublishOnly:checkout": "git checkout main", + "prepublishOnly:pull": "git pull", + "prepublishOnly:install": "npm ci", + "prepublishOnly:test": "npm test" }, "repository": { "type": "git", @@ -70,6 +75,7 @@ }, "husky": { "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", "pre-commit": "prettier --check ." } }, From 688eed765f9611033620eb50a3951e2d8d01aff3 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Thu, 18 Mar 2021 17:27:51 +0100 Subject: [PATCH 2/2] chore: replace RELEASE.md with CONTRIBUTING.md --- CONTRIBUTING.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ RELEASE.md | 4 ---- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 RELEASE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..0caef1cda9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,47 @@ +# Contributions + +🎉 Thanks for considering contributing to this project! 🎉 + +These guidelines will help you send a pull request. + +If you're submitting an issue instead, please skip this document. + +If your pull request is related to a typo or the documentation being unclear, please click on the relevant page's `Edit` +button (pencil icon) and directly suggest a correction instead. + +This project was made with ❤️. The simplest way to give back is by starring and sharing it online. + +Everyone is welcome regardless of personal background. We enforce a [Code of conduct](CODE_OF_CONDUCT.md) in order to +promote a positive and inclusive environment. + +## Development process + +First fork and clone the repository. If you're not sure how to do this, please watch +[these videos](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). + +Run: + +```bash +npm install +``` + +Make sure everything is correctly setup with: + +```bash +npm test +``` + +## How to write commit messages + +We use [Conventional Commit messages](https://www.conventionalcommits.org/) to automate version management. + +Most common commit message prefixes are: + +* `fix:` which represents bug fixes, and generate a patch release. +* `feat:` which represents a new feature, and generate a minor release. +* `feat!:`, `fix!:` or `refactor!:` and generate a major release. + +## Releasing + +1. Merge the release PR +2. Run `npm publish` diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 205a9a3f68..0000000000 --- a/RELEASE.md +++ /dev/null @@ -1,4 +0,0 @@ -# Releasing - -1. Merge the release PR -2. Run `npm publish`