-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
This is an in-depth tutorial on how to set the template up.
If you have advanced experience with GitHub, you can read a summary of this tutorial here.
To get started with the cli-template, you have to create a repository first.
To do this, you can click the Use this template button, on the top of the site.
After that, you have to wait for your repository to be created.
By enabling GitHub Pages, a website, containing your generated docs, will be published automatically.
Go to Repository Settings -> Pages
and set the source branch to main
and the path to /docs
.
A Personal Access Token
is needed, to push new versions.
You can generate a new access token here: https://github.com/settings/tokens
You have to set a name, and the scope should include repo
.
You can click Generate token now.
Copy the generated token and save it somewhere, if you want to reuse it for different projects.
You have to set the Personal Access Token
as a secret in the repository settings, to enable automatic releases.
Go to your Repository Settings -> Secrets -> New repository secret
Set the secret name to REPO_ACCESS_TOKEN
and paste your secret into the body.
Now click on Add secret
If you finished all the steps above, you can start making some changes in the code now!
You might want to start with removing the template app, by removing the files: /cmd/date.go
and /cmd/time.go
.
Then you might want to change the description of your app. Do this in /cmd/root.go
.
You're now ready for your first release! Don't worry, the first release does not need to contain any functionality, it's just to set up the CI system,
and automate further releases.
The first release will not be automated!
To create the very first release, you can click on the release
badge in your README.
After that, click on Create a new release
You will now see the release page.
Set the tag and title to v0.0.1
and hit Publish release
You're done! 🎉
You can now start to create your CLI tool!
To publish further releases, you just have to change the version in /cmd/root.go
and push the change.
Our custom CI-System will do the rest.
@PTerm · Maintainer @MarvinJWendt