Hosting on GitHub
Create a repository with the same
descriptionas specified in your
Add and commit everything:
$ git add -A && git commit -am "shard complete"
- Add the remote: (Be sure to replace
NOTE: If you like, feel free to replace
origin, or a remote name of your choosing.
$ git remote add public https://github.com/<YOUR-GITHUB-NAME>/<YOUR-REPOSITORY-NAME>.git
- Push it:
$ git push public master
It's good practice to do GitHub Releases.
Add the following markdown build badge below the description in your README to inform users what the most current release is:
(Be sure to replace
[![GitHub release]( )]( )
Start by navigating to your repository's releases page.
- This can be found at
Click "Create a new release".
According to the Crystal Shards README,
When libraries are installed from Git repositories, the repository is expected to have version tags following a semver-like format, prefixed with a
v. Examples: v1.2.3, v2.0.0-rc1 or v2017.04.1
Accordingly, in the input that says
tag version, type
v0.1.0. Make sure this matches the
shard.yml. Title it
v0.1.0 and write a short description for the release.
Click "Publish release" and you're done!
You'll now notice that the GitHub Release badge has updated in your README.
Follow Semantic Versioning and create a new release every time your push new code to
Travis CI and
If you haven't already, sign up for Travis CI.
Insert the following markdown build badge below the description in your README.md:
(be sure to replace
[![Build Status]( )]( )
Build badges are a simple way to tell people whether your Travis CI build passes.
Add the following lines to your
script: - crystal spec
This tells Travis CI to run your tests. Accordingly with the outcome of this command, Travis CI will return a build status of "passed", "errored", "failed" or "canceled".
If you want to verify that all your code has been formatted with
crystal tool format, add a script for
crystal tool format --check. If the code is not formatted correctly, this will break the build just as failing tests would.
script: - crystal spec - crystal tool format --check
Commit and push to GitHub.
Follow these guidelines to get your repo up & running on Travis CI.
Once you're up and running, and the build is passing, the build badge will update in your README.
docs on GitHub-Pages
Add the following
script to your
- crystal docs
This tells Travis CI to generate your documentation.
Next, add the following lines to your
(Be sure to replace all instances of
deploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN project_name: <YOUR-GITHUB-REPOSITORY-NAME> on: branch: master local_dir: docs
If you've been following along, your
.travis.yml file should look something like this:
language: crystal script: - crystal spec - crystal docs deploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN project_name: <YOUR-GITHUB-REPOSITORY-NAME> on: branch: master local_dir: docs
Click Here for the official documentation on deploying to GitHub-Pages with Travis CI.