Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: 1.25.x

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: '~> v2'
workdir: ./cmd/github-ci
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
.vscode/

dist/
coverage.out
.github-ci.yaml
/github-ci
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ A CLI tool for managing GitHub Actions workflows. It helps lint workflows for be
# Install
go install github.com/reugn/github-ci/cmd/github-ci@latest

# Verify
github-ci --version

# Initialize config
github-ci init

Expand All @@ -60,6 +63,10 @@ go install github.com/reugn/github-ci/cmd/github-ci@latest

Make sure `$GOPATH/bin` or `$GOBIN` is in your `$PATH`.

### From Releases

Download the latest binary for your platform from [Releases](https://github.com/reugn/github-ci/releases).

### From Source

```bash
Expand Down
61 changes: 61 additions & 0 deletions cmd/github-ci/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: 2

project_name: github-ci

builds:
- main: .
ldflags:
- -s -w -X main.version={{ .Version }}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64

archives:
- name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- if eq .Os "darwin" }}macos
{{- else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
formats: [ 'zip' ]

changelog:
use: github
format: "{{ .SHA }}: {{ .Message }}{{ with .AuthorUsername }} (@{{ . }}){{ end }}"
filters:
exclude:
- "^Merge pull request"
- "^Merge branch"
groups:
- title: "Features"
regexp: '^.*?feat(\([^)]+\))?!?:.+$'
order: 10
- title: "Fixes"
regexp: '^.*?fix(\([^)]+\))?!?:.+$'
order: 20
- title: "Improvements"
regexp: '^.*?(refactor|perf)(\([^)]+\))?!?:.+$'
order: 30
- title: "Documentation updates"
regexp: '^.*?docs?(\([^)]+\))?!?:.+$'
order: 40
- title: "Maintenance"
order: 999

checksum:
name_template: "checksums.txt"

release:
draft: true
name_template: "v{{ .Version }}"
footer: >-
**Full Changelog**:
https://github.com/{{ .Env.GITHUB_REPOSITORY }}/compare/{{ .PreviousTag }}...{{ .Tag }}
4 changes: 4 additions & 0 deletions cmd/github-ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import (
"github.com/reugn/github-ci/internal/cmd"
)

// version is set by goreleaser via ldflags
var version = "dev"

func main() {
cmd.SetVersion(version)
cmd.Execute()
}
2 changes: 1 addition & 1 deletion docs/_includes/head_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
document.documentElement.setAttribute('data-theme', jtdTheme);
</script>

<!-- Theme stylesheets - disabled state set dynamically -->
<!-- Theme stylesheets; JS toggles disabled state based on saved theme -->
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-light.css' | relative_url }}" id="jtd-light">
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-dark.css' | relative_url }}" id="jtd-dark">
<script>
Expand Down
7 changes: 6 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ go install github.com/reugn/github-ci/cmd/github-ci@latest

Make sure `$GOPATH/bin` or `$GOBIN` is in your `$PATH`.

## From Releases

Download the latest binary for your platform from [Releases](https://github.com/reugn/github-ci/releases).

## From Source

Clone the repository and build manually:
Expand All @@ -31,10 +35,11 @@ sudo mv github-ci /usr/local/bin/
## Verify Installation

```bash
github-ci --version
github-ci --help
```

You should see the available commands and options.
You should see the version and the available commands.

## Authentication

Expand Down
5 changes: 5 additions & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ var rootCmd = &cobra.Command{
SilenceErrors: true,
}

// SetVersion sets the version string for the CLI.
func SetVersion(version string) {
rootCmd.Version = version
}

func Execute() {
if err := rootCmd.Execute(); err != nil {
printError("%v", err)
Expand Down
Loading