chip8-rust / chip8-vm

CHIP-8 virtual machine implementation in the Rust programming language
https://chip8-rust.github.io/chip8-vm/
MIT License
13 stars 1 forks source link

Automatically publish crate versions #5

Closed robo9k closed 9 years ago

robo9k commented 9 years ago

Users either need to use

[dependencies.chip8_vm]
git = "https://github.com/chip8-rust/chip8-vm"

or

[dependencies]
chip8_vm = "0.*"

to download the latest version from git or crates.io.

The problem is that one can not publish a crate on crates.io if it has git dependencies, see chip8-rust/chip8-ui#13. So for users it would be better if both the latest published crate and the latest (working) git commit are the same thing and we could just recommend to use crates.io.

There's a comment on reddit:

I actually have a feature request in for cargo that makes cargo package create the git tag.

Meanwhile we could use bumpversion (requires Python) or possibly some hacky shell script (see reddit thread as well).

I'd imagine the workflow to be like this;

$ # create one or more commits to fix rustc issues or introduce new features
$ # `git push` those commits
$ # decide whether those changes are a `semver.org` "minor" or "patch" change
$ bumpversion patch
$ # bumpversion increments the version, creates a new git commit and tag
$ git push --tags

(semver because that's what crates.io uses) (the git commit would look like https://github.com/robo9k/rust-magic/commit/298aeb4f5b008e920f1fdd1812ace9d4b673598f ) Now CI builds that commit as usual and since the version is tagged, it runs cargo publish. Meanwhile it could also add some files to the GitHub releases (e.g. the .crate) associated with the git tag.

Now crates.io has a new version and users can just run cargo update --package chip8_vm.

robo9k commented 9 years ago

@jakerr what are your thoughts on this, are you okay with using bumpversion and its dependency on Python, or would you rather like a shell script or similar? Do you think automatically publishing crates upon Git version tags is a good idea in general? Is the general workflow allright or is there more to automate or simplify?

robo9k commented 9 years ago

Testing in 36af774c10550cd9e326fd6c92e6f878d2dfbe10. Fixing via 52ca2c72152baff2e25f0d5631462b8a02add3e3 and new test in 7847b9325caaf18bcb92b8060bef85d736259d3e.

Looks like it's working like I intended. Still waiting for feedback from @jakerr

robo9k commented 9 years ago

Closing this, since I've been using the implemented workflow a few times now. Still no feedback from @jakerr , but feel free to re-open!