Skip to content

Commit

Permalink
separate development things to CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 4, 2019
1 parent bfdb439 commit 4cd0944
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 51 deletions.
82 changes: 82 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,82 @@
# Development

Repository for `git-brws` is [hosted at GitHub][github-repo].


## Run tests

To watch file changes and run linter/tests automatically:

```sh
cargo install cargo-watch
cargo watch -x clippy -x test
```

Some tests require GitHub API access token. To run full tests:

```sh
export GITHUB_TOKEN=xxxxxxxxxxx
cargo test
```

Note: Without `GITHUB_TOKEN` environment variable, `cargo test` runs test cases partially though it
says every test case was run. This is because `cargo test` does not provide a way to skip test cases
dynamically in source.

`cargo test` and `cargo clippy` are automatically run on pushing to remote by [cargo-husky][].
But some tests fail when the remote tracking branch does not exist. When you create a new branch,
please use `--no-verify`. Please do not use `--no-verify` otherwise.

```sh
git checkout -b new-branch
git push -u origin new-branch --no-verify
```


## Prepare manpage

To update manpage file `git-brws.1` and `docs/index.html`, please edit `git-brws.1.ronn` and generate
`git-brws.1` automatically with `docs/gen.sh` script. [ronn][] is necessary as a dependency.

```sh
gem install ronn
./docs/gen.sh
```


## Update Homebrew formula

To update [Homebrew][homebrew] formula file, please use `HomebrewFormula/update.sh`.

For example, when updating to 0.9.2:

```sh
./HomebrewFormula/update.sh 0.9.2
```


## Update changelog

To update changelog, please run [changelog-from-release][] after describing release note at GitHub
repository. It regenerates `CHANGELOG.md` from releases on GitHub.

```sh
go get github.com/rhysd/changelog-from-release
changelog-from-release
```


## Release process

1. Run `export GITHUB_TOKEN=...`
2. Run `cargo release` which will create a new tag and push it to remote
3. CI services will prepare binaries
4. Write release note at https://github.com/rhysd/git-brws/releases
5. Update changelog
6. Update Homebrew formula

[github-repo]: https://github.com/rhysd/git-brws
[cargo-husky]: https://github.com/rhysd/cargo-husky
[ronn]: https://github.com/rtomayko/ronn
[changelog-from-release]: https://github.com/rhysd/changelog-from-release
[homebrew]: https://brew.sh/
52 changes: 1 addition & 51 deletions README.md
Expand Up @@ -336,64 +336,14 @@ Please see [the project page](https://github.com/rhysd/git-brws/projects/1).

## Development

Repository for `git-brws` is [hosted at GitHub][github-repo].
Please see [CONTRIBUTING.md](https://github.com/rhysd/git-brws/blob/master/CONTRIBUTING.md).

To watch file changes and run linter/tests automatically:

```sh
cargo install cargo-watch
cargo watch -x clippy -x test
```

Some tests require GitHub API access token. To run full tests:

```sh
export GITHUB_TOKEN=xxxxxxxxxxx
cargo test
```

`cargo test` and `cargo clippy` are automatically run on pushing to remote by [cargo-husky](https://github.com/rhysd/cargo-husky).
But some tests fail when the remote tracking branch does not exist. When you create a new branch,
please use `--no-verify`. Please do not use `--no-verify` otherwise.

```sh
git checkout -b new-branch
git push -u origin new-branch --no-verify
```

To update manpage file `git-brws.1` and `docs/index.html`, please edit `git-brws.1.ronn` and generate
`git-brws.1` automatically with `docs/gen.sh` script. [ronn][] is necessary as a dependency.

```sh
gem install ronn
./docs/gen.sh
```

To update Homebrew formula file, please use `HomebrewFormula/update.sh`.

For example, when updating to 0.9.2:

```sh
./HomebrewFormula/update.sh 0.9.2
```

To update changelog, please run [changelog-from-release][] after describing release note at GitHub
repository. It regenerates `CHANGELOG.md` from releases on GitHub.

```sh
go get github.com/rhysd/changelog-from-release
changelog-from-release
```

[github-repo]: https://github.com/rhysd/git-brws
[crate-badge]: https://img.shields.io/crates/v/git-brws.svg
[crate]: https://crates.io/crates/git-brws
[travis-ci]: https://travis-ci.org/rhysd/git-brws
[travis-badge]: https://travis-ci.org/rhysd/git-brws.svg?branch=master
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/q9gvpd30k1k5jsf0/branch/master?svg=true
[appveyor]: https://ci.appveyor.com/project/rhysd/git-brws/branch/master
[release page]: https://github.com/rhysd/git-brws/releases
[ronn]: https://github.com/rtomayko/ronn
[gitlab-pages]: https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html#project-websites
[bitbucket-cloud]: https://confluence.atlassian.com/bitbucket/publishing-a-website-on-bitbucket-cloud-221449776.html
[changelog-from-release]: https://github.com/rhysd/changelog-from-release

0 comments on commit 4cd0944

Please sign in to comment.