Hosting on GitHub
Add and commit everything:
Add the remote: (Be sure to replace
<YOUR-GITHUB-USERNAME>
and<YOUR-REPOSITORY-NAME>
accordingly)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 <YOUR-GITHUB-USERNAME>
and <YOUR-REPOSITORY-NAME>
accordingly)
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 version
in 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.
Continuous integration
GitHub Actions allows you to automatically test your project on every commit. Configure it according to the dedicated guide.
You can also below the description in your README.md.
As an extension of the GitHub Actions config, you can add the steps to build the API doc site and then upload them, correspondingly:
steps:
- name: Build docs
run: crystal docs
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: ...
with:
...
— where the latter ...
placeholder is any of the generic GitHub Actions to push a directory to the gh-pages branch. Some options are:
- JamesIves/github-pages-deploy-action []
- crazy-max/ghaction-github-pages []
- oprypin/push-to-gh-pages []
This uses Crystal’s built-in API doc generator to make a generic site based on your code and comments to the items in it.
Rather than just publishing the generated API docs, consider also making a full textual manual of your project, for a well-rounded introduction.