Skip to content

Commit e08472e

Browse files
Merge pull request #1 from openapi/upkeep
Add CI workflow, update documentation, and convert examples to Go
2 parents ac8473d + 3d16383 commit e08472e

14 files changed

Lines changed: 758 additions & 50 deletions

File tree

.convcommit

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# convcommit - Conventional Commit message builder
2+
# This file is read by the `convcommit` CLI tool to populate
3+
# the interactive selector menus.
4+
# Commit this file to share the project's commit vocabulary with the team.
5+
#
6+
# FORMAT
7+
# type:<value> — commit type option (e.g. fix, feat, docs)
8+
# scope:<value> — commit scope option
9+
# message:<value> — commit message template
10+
#
11+
# SPECIAL PREFIXES
12+
# ~<value> — marks the default selection
13+
# _ — enables free-text manual input (press ".")
14+
# [X]<value> — forces key letter X for this entry (e.g. [B]build, [W]wip)
15+
#
16+
# HOW TO USE (interactive)
17+
# Run `convcommit` in a git repo. A menu appears for type, scope, message.
18+
# Press the letter in brackets [A][B]... or [.] for free-text input.
19+
# Stage and push in one shot:
20+
# convcommit -a -p
21+
#
22+
# HOW TO USE (direct flags — scripts, AI agents)
23+
# Bypass the selector entirely with explicit flags:
24+
# convcommit --type fix --scope auth --message "fix null pointer" --push
25+
# convcommit -t feat -s api -m "add endpoint" -a -p
26+
#
27+
# SMART PATTERN — stage specific files and commit in one command
28+
# Use --add instead of nested command substitution.
29+
# Anti-pattern (avoid):
30+
# msg=$(convcommit --type fix --message "fix") && git commit -m "$msg" && git push
31+
# Recommended:
32+
# convcommit --add src/auth.sh --type fix --scope auth --message "fix null pointer" --push
33+
# Stage multiple files:
34+
# convcommit --add src/auth.sh --add tests/auth_test.sh -t test -s auth -m "add tests" -p
35+
#
36+
# HOW TO USE (pipe / non-interactive)
37+
# Pipe selections as lines: one per stage (type, scope, message).
38+
# Use the letter shown in the menu, or "." to trigger free-text input.
39+
# Examples:
40+
# printf "G\n.\nfix null pointer in login\n" | convcommit
41+
# printf "F\n\nadd endpoint\n" | convcommit -a -p
42+
# Capture just the formatted message:
43+
# msg=$(printf "G\n\nfix null pointer\n" | convcommit)
44+
#
45+
# OTHER USEFUL FLAGS
46+
# --reset Regenerate this file with the latest defaults
47+
# --help Show all options
48+
#
49+
# INSTALLATION
50+
# convcommit is a single bash file with no dependencies.
51+
# Install it locally in your project:
52+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
53+
# -o bin/convcommit && chmod +x bin/convcommit
54+
# Or system-wide:
55+
# curl -fsSL https://raw.githubusercontent.com/francescobianco/convcommit/refs/heads/main/bin/convcommit \
56+
# -o /usr/local/bin/convcommit && chmod +x /usr/local/bin/convcommit
57+
type:[B]build
58+
type:~chore
59+
type:[D]docs
60+
type:deps
61+
type:feat
62+
type:fix
63+
type:ci
64+
type:init
65+
type:merge
66+
type:perf
67+
type:refactor
68+
type:revert
69+
type:security
70+
type:style
71+
type:test
72+
type:[W]wip
73+
scope:_
74+
scope:~
75+
message:_
76+
message:~_

.github/assets/repo-header-a3.png

82.8 KB
Loading

.github/workflows/go.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
name: build
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version: '1.20'
21+
22+
- name: Build
23+
run: go build -v ./...
24+
25+
- name: Test
26+
run: go test -v ./...

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# IDEs and editors
2+
.idea/
3+
.vscode/
4+
15
# If you prefer the allow list template instead of the deny list, see community template:
26
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
37
#

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Openapi®
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!make
2+
3+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4+
# #
5+
# ____ _ #
6+
# / __ \____ ___ ____ ____ _____ (_) ® #
7+
# / / / / __ \/ _ \/ __ \/ __ `/ __ \/ / #
8+
# / /_/ / /_/ / __/ / / / /_/ / /_/ / / #
9+
# \____/ .___/\___/_/ /_/\__,_/ .___/_/ #
10+
# /_/ /_/ #
11+
# #
12+
# The Largest Certified API Marketplace #
13+
# Accelerate Digital Transformation • Simplify Processes • Lead Industry #
14+
# #
15+
# ═══════════════════════════════════════════════════════════════════════ #
16+
# #
17+
# Project: openapi-go-sdk #
18+
# Version: 0.1.0 #
19+
# Author: L. Paderi (@lpaderiAltravia) #
20+
# Copyright: (c) 2025 Openapi®. All rights reserved. #
21+
# License: MIT #
22+
# Maintainer: Francesco Bianco #
23+
# Contact: https://openapi.com/ #
24+
# Repository: https://github.com/openapi/openapi-go-sdk/ #
25+
# Documentation: https://console.openapi.com/ #
26+
# #
27+
# ═══════════════════════════════════════════════════════════════════════ #
28+
# #
29+
# "Truth lies at the source of the stream." #
30+
# — English Proverb #
31+
# #
32+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
33+
34+
## =========
35+
## Variables
36+
## =========
37+
38+
VERSION := 0.2.1
39+
TAG := v$(VERSION)
40+
41+
## ====================
42+
## Development Commands
43+
## ====================
44+
45+
test:
46+
@go test ./...
47+
48+
vet:
49+
@go vet ./...
50+
51+
dev-push:
52+
@git config credential.helper 'cache --timeout=3600'
53+
@git add .
54+
@git commit -m "$$(read -p 'Commit message: ' msg; echo $$msg)" || true
55+
@git push
56+
57+
## ================
58+
## Release Commands
59+
## ================
60+
61+
push:
62+
@git add .
63+
@git commit -am "Updated at $$(date)" || true
64+
@git push
65+
66+
release:
67+
@echo "==> Releasing $(TAG)..."
68+
@if [ "$$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then \
69+
echo "ERROR: releases must be cut from the main branch"; exit 1; \
70+
fi
71+
@if [ -n "$$(git status --porcelain)" ]; then \
72+
echo "ERROR: working directory is not clean"; exit 1; \
73+
fi
74+
@echo "==> Running tests..."
75+
@go test ./...
76+
@echo "==> Running vet..."
77+
@go vet ./...
78+
@echo "==> Tagging $(TAG)..."
79+
@git tag -a "$(TAG)" -m "Release $(TAG)"
80+
@git push origin "$(TAG)"
81+
@echo "==> Creating GitHub release..."
82+
@gh release create "$(TAG)" \
83+
--title "$(TAG)" \
84+
--generate-notes \
85+
--verify-tag
86+
@echo "==> Done. Release $(TAG) is live."

0 commit comments

Comments
 (0)