PileProject / drivecommand

A communication library which connects a robot (EV3, NXT, etc.) and a device (Android, PC, etc.)
Other
14 stars 4 forks source link

Introduce an auto deploy feature #22

Closed tiwanari closed 7 years ago

tiwanari commented 7 years ago

resolves #20.

This PR introduces a feature of auto deploy.

Procedure

  1. Merge changes into master (e.g., git checkout master; git merge develop)
  2. Edit the version of the project in build.gradle (this line)
  3. Run a task (./gradlew uploadArchives)
  4. Make a commit (e.g., git add .; git commit -m "Release v2.2.0")
  5. Make a tag (e.g., git tag v2.2.0)
  6. Push changes (git push --follow-tags)

Then, gh-pages branch will be updated automatically :tada:

References

mandaiy commented 7 years ago

I don't know this magical things but seems ok. Did you test this?

tiwanari commented 7 years ago

Yes, I tested the procedure with my forked repository and it worked. But, strictly speaking, I haven't tested this PR because the secure was newly created for this repository. I hope it works properly 🙏

TL; DR

I copied the script and the changes on .travis.yml for this PR, and made a new personal access token on my https://github.com/settings/tokens page by checking only Access public repositories.

After getting the token, I ran the following command for this repository:

travis encrypt -r PileProject/drivecommand "GH_TOKEN=TOKEN" --add

and this added some lines into .travis.yml automatically. The result is this PR.

tiwanari commented 7 years ago

By the way, I'm not sure whether master branch should have release directory. And, I found it now diversed from gh-pages branch's release directory. What do you think? :)

tiwanari commented 7 years ago

Ah, I remembered that the uploadArchives task refers to the existing releases by checking maven metadata file. So, at least we should keep the file in master and keep (restore) the consistence.

tiwanari commented 7 years ago

Hey @makotoshimazu @myusak

Please give me comments or approvals:) I want to merge this and make v2.2.0 before merging #23 and making v2.3.0 tag for that.

mandaiy commented 7 years ago

I had a detailed look on your changes and now I have a few questions and comments.

Questions:

Comments:

-task wraper(type: Wrapper) {

tiwanari commented 7 years ago

Hi @myusak

I fixed scripts and tested them:)

Update

Thanks to your valuable comments, the procedure becomes much simpler 🎉

  1. Merge changes into master (e.g., git checkout master; git merge develop) ~1. Edit the version of the project in build.gradle (this line)~ ~1. Run a task (./gradlew uploadArchives)~ ~1. Make a commit (e.g., git add .; git commit -m "Release v2.2.0")~
  2. Make a tag (e.g., git tag v2.2.0)
  3. Push changes (git push --follow-tags)

Note

I specified the format of a tag for deploy to ^v[0-9].*$ and added a feature removing the prefix v in the task you suggested to follow the current naming rule of release folders.

Verification

This tag commit successfully deployed the release to /docs and this commit properly changed the source of the library in CI (and it has errors because the v.2.2.0 changed the signature of a function).

tiwanari commented 7 years ago

Thanks, @myusak !! :)

Let me merge it 🎉