|
| 1 | +# Contributing |
| 2 | + |
| 3 | +[](http://commitizen.github.io/cz-cli/) |
| 4 | +[](http://semver.org/spec/v2.0.0.html) |
| 5 | +[](https://gitter.im/Syncleus/aparapi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 6 | + |
| 7 | +When contributing to this repository, it is usually a good idea to first discuss the change you |
| 8 | +wish to make via issue, email, or any other method with the owners of this repository before |
| 9 | +making a change. This could potentially save a lot of wasted hours. |
| 10 | + |
| 11 | +Please note we have a code of conduct, please follow it in all your interactions with the project. |
| 12 | + |
| 13 | +## Development |
| 14 | + |
| 15 | +### Commit Message Format |
| 16 | + |
| 17 | +Starting version 1.3.3 and later all commits on the Syncleus Aparapi repository follow the |
| 18 | +[Conventional Changelog standard](https://github.com/conventional-changelog/conventional-changelog-eslint/blob/master/convention.md). |
| 19 | +It is a very simple format so you can still write commit messages by hand. However it is |
| 20 | +highly recommended developers install [Commitizen](https://commitizen.github.io/cz-cli/), |
| 21 | +it extends the git command and will make writing commit messages a breeze. All the Aparapi |
| 22 | +repositories are configured with local Commitizen configuration scripts. |
| 23 | + |
| 24 | +Getting Commitizen installed is usually trivial, just install it via npm. You will also |
| 25 | +need to install the cz-customizable adapter which the Aparapi repository is configured |
| 26 | +to use. |
| 27 | + |
| 28 | +```bash |
| 29 | + |
| 30 | + |
| 31 | +``` |
| 32 | + |
| 33 | +Below is an example of Commitizen in action. It replaces your usual `git commit` command |
| 34 | +with `git cz` instead. The new command takes all the same arguments however it leads you |
| 35 | +through an interactive process to generate the commit message. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +Commit messages are used to automatically generate our changelogs, and to ensure |
| 40 | +commits are searchable in a useful way. So please use the Commitizen tool and adhere to |
| 41 | +the commit message standard or else we cannot accept Pull Requests without editing |
| 42 | +them first. |
| 43 | + |
| 44 | +Below is an example of a properly formated commit message. |
| 45 | + |
| 46 | +``` |
| 47 | +chore(Commitizen): Made repository Commitizen friendly. |
| 48 | +
|
| 49 | +Added standard Commitizen configuration files to the repo along with all the custom rules. |
| 50 | +
|
| 51 | +ISSUES CLOSED: #31 |
| 52 | +``` |
| 53 | + |
| 54 | +### Pull Request Process |
| 55 | + |
| 56 | +1. Ensure that install or build dependencies do not appear in any commits in your code branch. |
| 57 | +2. Ensure all commit messages follow the [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog-eslint/blob/master/convention.md) |
| 58 | + standard explained earlier. |
| 59 | +3. Update the CONTRIBUTORS.md file to add your name to it if it isn't already there (one entry |
| 60 | + per person). |
| 61 | +4. Adjust the project version to the new version that this Pull Request would represent. The |
| 62 | + versioning scheme we use is [Semantic Versioning](http://semver.org/). |
| 63 | +5. Your pull request will either be approved or feedback will be given on what needs to be |
| 64 | + fixed to get approval. We usually review and comment on Pull Requests within 48 hours. |
| 65 | + |
| 66 | +### Making a Release |
| 67 | + |
| 68 | +Only administrators with privilages to push to the Aparapi Maven Central account can deploy releases. If this isn't you |
| 69 | +then you can just skip this section. |
| 70 | + |
| 71 | +First ensure the package is prepared for the release process: |
| 72 | + |
| 73 | +* Make sure any references to the version number in the readme is updated |
| 74 | + * Version number in dependency maven snippet. |
| 75 | + * Add new version to javadoc version list. |
| 76 | +* Ensure that none of the dependencies used are snapshots. |
| 77 | +* Update the changelog file. |
| 78 | +* Check that all Aparapi libraries used as dependencies point to the latest version. |
| 79 | +* After making the release go to the aparapi-docker project and push an image for the new aparapi version |
| 80 | + |
| 81 | +Next lets take a few steps to do the actual release: |
| 82 | + |
| 83 | +1. Update everything listed above. Do **not** drop the package version's `-SNAPSHOT` suffix in master. |
| 84 | +2. Create a release branch, but make sure never to push this branch to the server: `git checkout -b release`. |
| 85 | +3. Update the README.md again to ensure travis badge and javadoc badge point to static tag and not latest. |
| 86 | +4. Drop the `-SNAPSHOT` suffix from the package version. |
| 87 | +5. Commit the current changes using a generic commit message such as `build(release): version 1.2.3`. |
| 88 | +6. Fully test the software before deploying, run all tests and install locally to test against the examples package. |
| 89 | + You can install the package locally with `mvn clean install`. |
| 90 | +7. Once satisfied the package is stable deploy it to maven central by executing `mvn -P sign clean package deploy`. |
| 91 | +8. If deployment was successful then create a new tag for the current version with the following command: |
| 92 | + `git tag -a v1.2.3 -m "Version 1.2.3"`. |
| 93 | +9. Push the newly created tags to the server: `git push origin v1.2.3:v1.2.3`. |
| 94 | +10. Go to Github and go to the release. Update the description with the changelog for the version and upload |
| 95 | + all the artifacts in the target folder. |
| 96 | +10. Checkout master again and then delete the release branch: `git branch -D release`. |
| 97 | +11. Bump the snapshot version of the package to the next expected version, commiting the changes and pushing. |
| 98 | +12. Deploy the new snapshot to the snapshot repository (no need to sign): `mvn clean deploy`. |
0 commit comments