Simple, intuitive CLI framework for Go pkg.go.dev/go.followtheprocess.codes/cli
go cli
0

Configure Feed

Select the types of activity you want to include in your feed.

Initial Commit

Tom Fleet (Jul 6, 2024, 4:48 PM +0100) bf83547f

+962
+2
.gitattributes
··· 1 + # Auto detect text files and perform LF normalization 2 + * text=auto
+216
.gitignore
··· 1 + # Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go 2 + # Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,jetbrains+all,go 3 + 4 + ### Go ### 5 + # If you prefer the allow list template instead of the deny list, see community template: 6 + # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 7 + # 8 + # Binaries for programs and plugins 9 + *.exe 10 + *.exe~ 11 + *.dll 12 + *.so 13 + *.dylib 14 + 15 + # Test binary, built with `go test -c` 16 + *.test 17 + 18 + # Output of the go coverage tool, specifically when used with LiteIDE 19 + *.out 20 + coverage.html 21 + 22 + # Taskfile 23 + .task 24 + 25 + # Comparative benchmarks 26 + before.txt 27 + after.txt 28 + 29 + # Dependency directories (remove the comment below to include it) 30 + # vendor/ 31 + 32 + # Go workspace file 33 + go.work 34 + 35 + ### JetBrains+all ### 36 + # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 37 + # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 38 + 39 + # User-specific stuff 40 + .idea/**/workspace.xml 41 + .idea/**/tasks.xml 42 + .idea/**/usage.statistics.xml 43 + .idea/**/dictionaries 44 + .idea/**/shelf 45 + 46 + # AWS User-specific 47 + .idea/**/aws.xml 48 + 49 + # Generated files 50 + .idea/**/contentModel.xml 51 + 52 + # Sensitive or high-churn files 53 + .idea/**/dataSources/ 54 + .idea/**/dataSources.ids 55 + .idea/**/dataSources.local.xml 56 + .idea/**/sqlDataSources.xml 57 + .idea/**/dynamic.xml 58 + .idea/**/uiDesigner.xml 59 + .idea/**/dbnavigator.xml 60 + 61 + # Gradle 62 + .idea/**/gradle.xml 63 + .idea/**/libraries 64 + 65 + # Gradle and Maven with auto-import 66 + # When using Gradle or Maven with auto-import, you should exclude module files, 67 + # since they will be recreated, and may cause churn. Uncomment if using 68 + # auto-import. 69 + # .idea/artifacts 70 + # .idea/compiler.xml 71 + # .idea/jarRepositories.xml 72 + # .idea/modules.xml 73 + # .idea/*.iml 74 + # .idea/modules 75 + # *.iml 76 + # *.ipr 77 + 78 + # CMake 79 + cmake-build-*/ 80 + 81 + # Mongo Explorer plugin 82 + .idea/**/mongoSettings.xml 83 + 84 + # File-based project format 85 + *.iws 86 + 87 + # IntelliJ 88 + out/ 89 + 90 + # mpeltonen/sbt-idea plugin 91 + .idea_modules/ 92 + 93 + # JIRA plugin 94 + atlassian-ide-plugin.xml 95 + 96 + # Cursive Clojure plugin 97 + .idea/replstate.xml 98 + 99 + # SonarLint plugin 100 + .idea/sonarlint/ 101 + 102 + # Crashlytics plugin (for Android Studio and IntelliJ) 103 + com_crashlytics_export_strings.xml 104 + crashlytics.properties 105 + crashlytics-build.properties 106 + fabric.properties 107 + 108 + # Editor-based Rest Client 109 + .idea/httpRequests 110 + 111 + # Android studio 3.1+ serialized cache file 112 + .idea/caches/build_file_checksums.ser 113 + 114 + ### JetBrains+all Patch ### 115 + # Ignore everything but code style settings and run configurations 116 + # that are supposed to be shared within teams. 117 + 118 + .idea/* 119 + 120 + !.idea/codeStyles 121 + !.idea/runConfigurations 122 + 123 + ### Linux ### 124 + *~ 125 + 126 + # temporary files which can be created if a process still has a handle open of a deleted file 127 + .fuse_hidden* 128 + 129 + # KDE directory preferences 130 + .directory 131 + 132 + # Linux trash folder which might appear on any partition or disk 133 + .Trash-* 134 + 135 + # .nfs files are created when an open file is removed but is still being accessed 136 + .nfs* 137 + 138 + ### macOS ### 139 + # General 140 + .DS_Store 141 + .AppleDouble 142 + .LSOverride 143 + 144 + # Icon must end with two \r 145 + Icon 146 + 147 + 148 + # Thumbnails 149 + ._* 150 + 151 + # Files that might appear in the root of a volume 152 + .DocumentRevisions-V100 153 + .fseventsd 154 + .Spotlight-V100 155 + .TemporaryItems 156 + .Trashes 157 + .VolumeIcon.icns 158 + .com.apple.timemachine.donotpresent 159 + 160 + # Directories potentially created on remote AFP share 161 + .AppleDB 162 + .AppleDesktop 163 + Network Trash Folder 164 + Temporary Items 165 + .apdisk 166 + 167 + ### macOS Patch ### 168 + # iCloud generated files 169 + *.icloud 170 + 171 + ### VisualStudioCode ### 172 + .vscode/* 173 + !.vscode/settings.json 174 + !.vscode/tasks.json 175 + !.vscode/launch.json 176 + !.vscode/extensions.json 177 + !.vscode/*.code-snippets 178 + 179 + # Local History for Visual Studio Code 180 + .history/ 181 + 182 + # Built Visual Studio Code Extensions 183 + *.vsix 184 + 185 + ### VisualStudioCode Patch ### 186 + # Ignore all local history of files 187 + .history 188 + .ionide 189 + 190 + ### Windows ### 191 + # Windows thumbnail cache files 192 + Thumbs.db 193 + Thumbs.db:encryptable 194 + ehthumbs.db 195 + ehthumbs_vista.db 196 + 197 + # Dump file 198 + *.stackdump 199 + 200 + # Folder config file 201 + [Dd]esktop.ini 202 + 203 + # Recycle Bin used on file shares 204 + $RECYCLE.BIN/ 205 + 206 + # Windows Installer files 207 + *.cab 208 + *.msi 209 + *.msix 210 + *.msm 211 + *.msp 212 + 213 + # Windows shortcuts 214 + *.lnk 215 + 216 + # End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go
+127
.golangci.yml
··· 1 + linters: 2 + disable-all: true 3 + enable: 4 + - bodyclose 5 + - containedctx 6 + - durationcheck 7 + - errcheck 8 + - errchkjson 9 + - errname 10 + - exhaustive 11 + - exportloopref 12 + - goconst 13 + - gocritic 14 + - gocyclo 15 + - godot 16 + - gofumpt 17 + - goimports 18 + - gosimple 19 + - govet 20 + - ineffassign 21 + - misspell 22 + - mnd 23 + - nilerr 24 + - nilnil 25 + - nolintlint 26 + - nakedret 27 + - predeclared 28 + - reassign 29 + - revive 30 + - staticcheck 31 + - tagliatelle 32 + - tenv 33 + - testpackage 34 + - thelper 35 + - unconvert 36 + - unparam 37 + - unused 38 + - whitespace 39 + 40 + linters-settings: 41 + errcheck: 42 + check-type-assertions: true 43 + check-blank: true 44 + 45 + exhaustive: 46 + check: 47 + - switch 48 + - map 49 + default-signifies-exhaustive: true 50 + 51 + gocyclo: 52 + min-complexity: 20 53 + 54 + staticcheck: 55 + checks: ["all"] 56 + 57 + gosimple: 58 + checks: ["all"] 59 + 60 + govet: 61 + enable-all: true 62 + 63 + revive: 64 + max-open-files: 256 65 + ignore-generated-header: true 66 + rules: 67 + - name: argument-limit 68 + disabled: false 69 + arguments: [5] 70 + 71 + - name: atomic 72 + disabled: false 73 + 74 + - name: blank-imports 75 + disabled: false 76 + 77 + - name: call-to-gc 78 + disabled: false 79 + 80 + - name: constant-logical-expr 81 + disabled: false 82 + 83 + - name: context-as-argument 84 + disabled: false 85 + 86 + - name: datarace 87 + disabled: false 88 + 89 + - name: deep-exit 90 + disabled: false 91 + 92 + - name: defer 93 + disabled: false 94 + 95 + - name: dot-imports 96 + disabled: false 97 + 98 + - name: early-return 99 + disabled: false 100 + 101 + - name: exported 102 + arguments: 103 + - checkPrivateReceivers 104 + 105 + - name: modifies-value-receiver 106 + disabled: false 107 + 108 + - name: package-comments 109 + disabled: false 110 + 111 + - name: range 112 + disabled: false 113 + 114 + - name: range-val-in-closure 115 + disabled: false 116 + 117 + - name: range-val-address 118 + disabled: false 119 + 120 + - name: time-equal 121 + disabled: false 122 + 123 + - name: use-any 124 + disabled: false 125 + 126 + - name: waitgroup-by-value 127 + disabled: false
+22
LICENSE
··· 1 + 2 + MIT License 3 + 4 + Copyright (c) 2024, Tom Fleet 5 + 6 + Permission is hereby granted, free of charge, to any person obtaining a copy 7 + of this software and associated documentation files (the "Software"), to deal 8 + in the Software without restriction, including without limitation the rights 9 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 + copies of the Software, and to permit persons to whom the Software is 11 + furnished to do so, subject to the following conditions: 12 + 13 + The above copyright notice and this permission notice shall be included in all 14 + copies or substantial portions of the Software. 15 + 16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 + SOFTWARE.
+40
README.md
··· 1 + # CLI 2 + 3 + [![License](https://img.shields.io/github/license/FollowTheProcess/cli)](https://github.com/FollowTheProcess/cli) 4 + [![Go Reference](https://pkg.go.dev/badge/github.com/FollowTheProcess/cli.svg)](https://pkg.go.dev/github.com/FollowTheProcess/cli) 5 + [![Go Report Card](https://goreportcard.com/badge/github.com/FollowTheProcess/cli)](https://goreportcard.com/report/github.com/FollowTheProcess/cli) 6 + [![GitHub](https://img.shields.io/github/v/release/FollowTheProcess/cli?logo=github&sort=semver)](https://github.com/FollowTheProcess/cli) 7 + [![CI](https://github.com/FollowTheProcess/cli/workflows/CI/badge.svg)](https://github.com/FollowTheProcess/cli/actions?query=workflow%3ACI) 8 + [![codecov](https://codecov.io/gh/FollowTheProcess/cli/branch/main/graph/badge.svg)](https://codecov.io/gh/FollowTheProcess/cli) 9 + 10 + Tiny, simple, minimal CLI framework for Go 11 + 12 + > [!WARNING] 13 + > **CLI is in early development and is not yet ready for use** 14 + 15 + ## Project Description 16 + 17 + `cli` is my attempt at making a very simple, minimalist, yet functional and powerful CLI framework for Go. Inspired by things like <https://github.com/spf13/cobra> and <https://github.com/urfave/cli>. 18 + 19 + *"So why make a new one?"* 20 + 21 + Good question 🤔 22 + 23 + 1) I love Cobra and use it in a lot of my own programs, but IMO it's unnecessarily complex. The `Command` struct has lots of fields, has many ways to do things, and a lot of options I never use. It's a fantastic library, but has suffered from success in the sense that everybody wants it to do everything, rather than remaining tightly focussed on the essentials 24 + 2) I feel like now we have generics and some other cool modern Go idioms, a CLI toolkit could be better designed and have a friendlier API, with less options and one clear way to do things 25 + 3) It's fun to implement cool things from scratch and stretch your programming legs on a new problem 26 + 27 + ## Installation 28 + 29 + ```shell 30 + go get github.com/FollowTheProcess/cli@latest 31 + ``` 32 + 33 + ## Quickstart 34 + 35 + ### Credits 36 + 37 + This package was created with [copier] and the [FollowTheProcess/go_copier] project template. 38 + 39 + [copier]: https://copier.readthedocs.io/en/stable/ 40 + [FollowTheProcess/go_copier]: https://github.com/FollowTheProcess/go_copier
+66
Taskfile.yml
··· 1 + # https://taskfile.dev 2 + 3 + version: "3" 4 + 5 + vars: 6 + COV_DATA: coverage.out 7 + 8 + tasks: 9 + default: 10 + desc: List all available tasks 11 + silent: true 12 + cmd: task --list 13 + 14 + tidy: 15 + desc: Tidy dependencies in go.mod and go.sum 16 + cmd: go mod tidy 17 + 18 + fmt: 19 + desc: Run go fmt on all source files 20 + cmd: go fmt ./... 21 + 22 + test: 23 + desc: Run the test suite 24 + cmd: go test -race ./... {{ .CLI_ARGS }} 25 + 26 + bench: 27 + desc: Run all project benchmarks 28 + cmd: go test ./... -run None -benchmem -bench . {{ .CLI_ARGS }} 29 + 30 + lint: 31 + desc: Run the linters and auto-fix if possible 32 + cmd: golangci-lint run --fix 33 + preconditions: 34 + - sh: command -v golangci-lint 35 + msg: golangci-lint not installed, see https://golangci-lint.run/usage/install/#local-installation 36 + 37 + doc: 38 + desc: Render the pkg docs locally 39 + cmd: pkgsite -open 40 + preconditions: 41 + - sh: command -v pkgsite 42 + msg: pkgsite not installed, run go install golang.org/x/pkgsite/cmd/pkgsite@latest 43 + 44 + cov: 45 + desc: Calculate test coverage and render the html 46 + generates: 47 + - "{{ .COV_DATA }}" 48 + cmds: 49 + - go test -race -cover -covermode atomic -coverprofile {{ .COV_DATA }} ./... 50 + - go tool cover -html {{ .COV_DATA }} 51 + 52 + check: 53 + desc: Run tests and linting in one 54 + cmds: 55 + - task: test 56 + - task: lint 57 + 58 + sloc: 59 + desc: Print lines of code 60 + cmd: fd . -e go | xargs wc -l | sort -nr | head 61 + 62 + clean: 63 + desc: Remove build artifacts and other clutter 64 + cmds: 65 + - go clean ./... 66 + - rm -rf {{ .COV_DATA }}
+7
cli.go
··· 1 + // Package cli is a placeholder for something cool. 2 + package cli 3 + 4 + // Hello returns a welcome message for the project. 5 + func Hello() string { 6 + return "Hello cli" 7 + }
+16
cli_test.go
··· 1 + package cli_test 2 + 3 + import ( 4 + "testing" 5 + 6 + "github.com/FollowTheProcess/cli" 7 + ) 8 + 9 + func TestHello(t *testing.T) { 10 + got := cli.Hello() 11 + want := "Hello cli" 12 + 13 + if got != want { 14 + t.Errorf("got %s, wanted %s", got, want) 15 + } 16 + }
+3
go.mod
··· 1 + module github.com/FollowTheProcess/cli 2 + 3 + go 1.22
+20
.github/PULL_REQUEST_TEMPLATE.md
··· 1 + <!-- Provide a brief summary of your changes in the Title above --> 2 + 3 + #### Description 4 + <!-- Describe your changes in detail --> 5 + 6 + #### Motivation and Context 7 + <!-- Why is this change required? What problem does it solve? --> 8 + <!-- If it fixes an open issue, please link to the issue here. --> 9 + Closes # 10 + 11 + #### How Has This Been Tested? 12 + <!-- Please describe in detail how you tested your changes. --> 13 + <!-- Include details of your testing environment, tests ran to see how --> 14 + <!-- your change affects other areas of the code, etc. --> 15 + 16 + #### Checklist 17 + <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> 18 + <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> 19 + - [ ] I have updated the documentation if needed. 20 + - [ ] I have updated the tests if needed.
+13
.github/dependabot.yml
··· 1 + version: 2 2 + 3 + updates: 4 + - package-ecosystem: github-actions 5 + directory: / 6 + schedule: 7 + interval: weekly 8 + 9 + - package-ecosystem: gomod 10 + directory: / 11 + rebase-strategy: auto 12 + schedule: 13 + interval: weekly
+75
.github/labels.yml
··· 1 + - name: breaking 2 + description: Breaking Changes 3 + color: bfd4f2 4 + 5 + - name: bug 6 + description: Something isn't working 7 + color: d73a4a 8 + 9 + - name: build 10 + description: Build System and Dependencies 11 + color: bfdadc 12 + 13 + - name: ci 14 + description: Continuous Integration 15 + color: 4a97d6 16 + 17 + - name: dependencies 18 + description: Pull requests that update a dependency file 19 + color: 0366d6 20 + 21 + - name: documentation 22 + description: Improvements or additions to documentation 23 + color: 0075ca 24 + 25 + - name: duplicate 26 + description: This issue or pull request already exists 27 + color: cfd3d7 28 + 29 + - name: enhancement 30 + description: New feature or request 31 + color: a2eeef 32 + 33 + - name: good first issue 34 + description: Good for newcomers 35 + color: 7057ff 36 + 37 + - name: help wanted 38 + description: Extra attention is needed 39 + color: 008672 40 + 41 + - name: invalid 42 + description: This doesn't seem right 43 + color: e4e669 44 + 45 + - name: performance 46 + description: Performance 47 + color: "016175" 48 + 49 + - name: question 50 + description: Further information is requested 51 + color: d876e3 52 + 53 + - name: refactoring 54 + description: Refactoring 55 + color: ef67c4 56 + 57 + - name: removal 58 + description: Removals and Deprecations 59 + color: 9ae7ea 60 + 61 + - name: style 62 + description: Style 63 + color: c120e5 64 + 65 + - name: chore 66 + description: General project admin 67 + color: cfd3d7 68 + 69 + - name: testing 70 + description: Testing 71 + color: b1fc6f 72 + 73 + - name: wontfix 74 + description: This will not be worked on 75 + color: ffffff
+42
.github/release-drafter.yml
··· 1 + name-template: "v$RESOLVED_VERSION" 2 + tag-template: "v$RESOLVED_VERSION" 3 + 4 + categories: 5 + - title: ":boom: Breaking Changes" 6 + label: breaking 7 + 8 + - title: ":rocket: Features" 9 + label: enhancement 10 + 11 + - title: ":fire: Removals and Deprecations" 12 + label: removal 13 + 14 + - title: ":beetle: Fixes" 15 + label: bug 16 + 17 + - title: ":racehorse: Performance" 18 + label: performance 19 + 20 + - title: ":rotating_light: Testing" 21 + label: testing 22 + 23 + - title: ":construction_worker: Continuous Integration" 24 + label: ci 25 + 26 + - title: ":books: Documentation" 27 + label: documentation 28 + 29 + - title: ":hammer: Refactoring" 30 + label: refactoring 31 + 32 + - title: ":lipstick: Style" 33 + label: style 34 + 35 + - title: ":package: Dependencies" 36 + labels: 37 + - dependencies 38 + - build 39 + 40 + template: | 41 + ## Changes 42 + $CHANGES
+59
.github/ISSUE_TEMPLATE/bug_report.yml
··· 1 + name: 🐞 Bug Report 2 + description: File a bug/issue 3 + title: "<title>" 4 + labels: 5 + - bug 6 + 7 + body: 8 + - type: checkboxes 9 + attributes: 10 + label: Is there an existing issue for this? 11 + description: Please search to see if an issue already exists for the bug you encountered. 12 + options: 13 + - label: I have searched the existing issues 14 + required: true 15 + 16 + - type: textarea 17 + attributes: 18 + label: Current Behavior 19 + description: A concise description of what you're experiencing. 20 + validations: 21 + required: false 22 + 23 + - type: textarea 24 + attributes: 25 + label: Expected Behavior 26 + description: A concise description of what you expected to happen. 27 + validations: 28 + required: false 29 + 30 + - type: textarea 31 + attributes: 32 + label: Steps To Reproduce 33 + description: Steps to reproduce the behavior. 34 + placeholder: | 35 + 1. In this environment... 36 + 2. With this config... 37 + 3. Run '...' 38 + 4. See error... 39 + validations: 40 + required: false 41 + 42 + - type: textarea 43 + attributes: 44 + label: Environment 45 + description: | 46 + Please describe your execution environment providing as much detail as possible 47 + render: Markdown 48 + validations: 49 + required: false 50 + 51 + - type: textarea 52 + attributes: 53 + label: Anything else? 54 + description: | 55 + Links? References? Anything that will give us more context about the issue you are encountering! 56 + 57 + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 58 + validations: 59 + required: false
+41
.github/ISSUE_TEMPLATE/feature_request.yml
··· 1 + name: 🚀 Feature Request 2 + description: Request a new feature or enhancement 3 + title: "<title>" 4 + labels: 5 + - enhancement 6 + body: 7 + - type: checkboxes 8 + attributes: 9 + label: Is there an existing issue for this? 10 + description: Please search to see if an issue already exists for the feature you want. 11 + options: 12 + - label: I have searched the existing issues 13 + required: true 14 + 15 + - type: textarea 16 + attributes: 17 + label: How would this feature be useful? 18 + description: Describe any use cases this solves or frustrations it alleviates. 19 + validations: 20 + required: false 21 + 22 + - type: textarea 23 + attributes: 24 + label: Describe the solution you'd like 25 + description: If you have an idea on how to do this, let us know here! 26 + validations: 27 + required: false 28 + 29 + - type: textarea 30 + attributes: 31 + label: Describe alternatives you've considered 32 + description: If there's some workaround or alternative solutions, let us know here! 33 + validations: 34 + required: false 35 + 36 + - type: textarea 37 + attributes: 38 + label: Anything else? 39 + description: Any other relevant information or background. 40 + validations: 41 + required: false
+28
.github/ISSUE_TEMPLATE/question.yml
··· 1 + name: ❓ Question 2 + description: Ask something about the project 3 + title: "<title>" 4 + labels: 5 + - question 6 + body: 7 + - type: checkboxes 8 + attributes: 9 + label: Is there an existing issue for this? 10 + description: Please search to see if an issue already exists for the question you want to ask. 11 + options: 12 + - label: I have searched the existing issues 13 + required: true 14 + 15 + - type: textarea 16 + attributes: 17 + label: Description 18 + description: Ask your question here. 19 + placeholder: How can I...? Is it possible to...? 20 + validations: 21 + required: false 22 + 23 + - type: textarea 24 + attributes: 25 + label: Anything else? 26 + description: Any other relevant information or background. 27 + validations: 28 + required: false
+86
.github/workflows/CI.yml
··· 1 + name: CI 2 + 3 + on: 4 + workflow_call: 5 + pull_request: 6 + push: 7 + branches: 8 + - main 9 + 10 + concurrency: 11 + group: ${{ github.workflow }}-${{ github.ref }} 12 + cancel-in-progress: true 13 + 14 + permissions: {} 15 + 16 + jobs: 17 + test: 18 + name: Test 19 + runs-on: ${{ matrix.os }} 20 + permissions: 21 + contents: read 22 + strategy: 23 + matrix: 24 + os: 25 + - ubuntu-latest 26 + - macos-latest 27 + - windows-latest 28 + 29 + steps: 30 + - name: Checkout Code 31 + uses: actions/checkout@v4 32 + 33 + - name: Set up Go 34 + uses: actions/setup-go@v5 35 + with: 36 + go-version-file: go.mod 37 + 38 + - name: Run Tests 39 + run: go test -race ./... 40 + 41 + cov: 42 + name: CodeCov 43 + runs-on: ubuntu-latest 44 + permissions: 45 + contents: read 46 + 47 + steps: 48 + - name: Checkout Code 49 + uses: actions/checkout@v4 50 + 51 + - name: Set up Go 52 + uses: actions/setup-go@v5 53 + with: 54 + go-version-file: go.mod 55 + 56 + - name: Run Tests 57 + run: go test -race -cover -covermode=atomic -coverprofile=./coverage.out ./... 58 + 59 + - name: Coverage 60 + uses: codecov/codecov-action@v4 61 + with: 62 + files: ./coverage.out 63 + # token: ${{ secrets.CODECOV_TOKEN }} 64 + 65 + lint: 66 + name: Lint 67 + runs-on: ubuntu-latest 68 + permissions: 69 + contents: read 70 + 71 + steps: 72 + - name: Checkout Code 73 + uses: actions/checkout@v4 74 + 75 + - name: Set up Go 76 + uses: actions/setup-go@v5 77 + with: 78 + go-version-file: go.mod 79 + 80 + - name: Clean Mod Cache # See https://github.com/golangci/golangci-lint-action/issues/135 81 + run: go clean -modcache 82 + 83 + - name: Run Linting 84 + uses: golangci/golangci-lint-action@v6 85 + with: 86 + version: latest
+24
.github/workflows/labeler.yml
··· 1 + name: Labeler 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + 8 + permissions: read-all 9 + 10 + jobs: 11 + labeler: 12 + name: Labeler 13 + runs-on: ubuntu-latest 14 + permissions: 15 + contents: write 16 + issues: write 17 + steps: 18 + - name: Check out the repository 19 + uses: actions/checkout@v4 20 + 21 + - name: Run Labeler 22 + uses: crazy-max/ghaction-github-labeler@v5 23 + with: 24 + skip-delete: false
+49
.github/workflows/release.yml
··· 1 + name: Release 2 + 3 + on: 4 + push: 5 + tags: 6 + - 'v[0-9]+.[0-9]+.[0-9]+' 7 + 8 + permissions: {} 9 + 10 + jobs: 11 + ci: 12 + name: CI 13 + uses: FollowTheProcess/cli/.github/workflows/CI.yml@main 14 + secrets: inherit 15 + permissions: 16 + contents: read 17 + 18 + release: 19 + name: Release 20 + runs-on: ubuntu-latest 21 + permissions: 22 + contents: write 23 + pull-requests: read 24 + 25 + needs: 26 + - ci 27 + 28 + steps: 29 + - name: Checkout Code 30 + uses: actions/checkout@v4 31 + with: 32 + fetch-depth: 0 33 + 34 + - name: Fetch Existing Tags 35 + run: git fetch --force --tags 36 + 37 + - name: Parse Release Version 38 + id: version 39 + run: | 40 + VERSION=${GITHUB_REF#refs/tags/v} 41 + echo "version=$VERSION" >> $GITHUB_OUTPUT 42 + 43 + - name: Publish Draft Release 44 + uses: release-drafter/release-drafter@v6 45 + with: 46 + version: ${{ steps.version.outputs.version }} 47 + publish: true 48 + env: 49 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+26
.github/workflows/release_drafter.yml
··· 1 + name: Release Drafter 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + pull_request: 8 + types: 9 + - opened 10 + - reopened 11 + - synchronize 12 + 13 + permissions: read-all 14 + 15 + jobs: 16 + draft_release: 17 + name: Draft Release 18 + runs-on: ubuntu-latest 19 + permissions: 20 + contents: write 21 + pull-requests: read 22 + steps: 23 + - name: Run Release Drafter 24 + uses: release-drafter/release-drafter@v6 25 + env: 26 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}