Discover Packages
github.com/smlx/go-cli-github
module
Version:
v0.3.1
Opens a new window with list of versions in this module.
Published: Aug 9, 2022
License: Apache-2.0
Opens a new window with license information.
README
README
¶
Go CLI Github
This repo is an example with basic workflows for a Go CLI tool hosted on Github.
It adds basic PR building, dependabot integration, testing, coverage etc.
How to use
Copy the contents of this repo into a new directory.
git clone git@github.com:smlx/go-cli-github.git $PROJECT_DIR && rm -rf ./$PROJECT_DIR/.git
Update the release
workflow branch from main
to foo
to disable it, commit all the files, and push to main
on a new repo.
Update for your project, send a PR and merge it once green:
rename deploy/go-cli-github
to deploy/$YOUR_COMMAND
update deploy/$YOUR_COMMAND/Dockerfile
rename cmd/go-cli-github
to cmd/$YOUR_COMMAND
update .goreleaser.yml
to build cmd/$YOUR_COMMAND
update the links at the top of the README
update the build
, release
, and tag-to-release
workflows, replacing go-cli-github
with $YOUR_COMMAND
.
update module in go.mod
and in cmd/$YOUR_COMMAND/*.go
, internal/server/serve_test.go
Go to repository Settings > General:
Disable wiki and projects
Allow only merge commits for Pull Requests
Allow auto-merge
Automatically delete head branches
Go to repository Settings > Branches and add branch protection to main
, and enable:
Require a PR before merging
Dismiss stale pull request approvals
Require status checks to pass before merging
Require branches to be up-to-date before merging.
Required status checks:
lint
commitlint
build
go-test
Include administrators
Go to repository Settings > Code security and analysis, and enable:
Dependabot alerts
Dependabot security updates
When ready to release, rename the target branch in the release workflow from foo
to main
, and send a PR.
That's it.
Expand ▾
Collapse ▴
Directories
¶
cmd
internal
Click to show internal directories.
Click to hide internal directories.