Skip to content

Commit 5b07d05

Browse files
feat: implement automated release system with package manager support
- Add .version file-based version management (0.1.0) - Implement comprehensive version management scripts - Update GoReleaser with v2 configuration and OpenMorph-specific repositories - Enhance GitHub Actions workflow with GoReleaser v2 support - Add automated Homebrew and Scoop package manager integration - Create validation and setup automation scripts - Update build system with proper version injection - Add comprehensive documentation for release process - Clean up project structure and improve gitignore - Add pagination priority feature with comprehensive API support - Prepare for clean v0.1.0 release with full automation This commit establishes a complete automated release pipeline with: - Homebrew tap: homebrew-openmorph - Scoop bucket: scoop-openmorph - Cross-platform binaries via GoReleaser - Automated package manager updates - Version management automation
1 parent 0a56472 commit 5b07d05

File tree

20 files changed

+4768
-51
lines changed

20 files changed

+4768
-51
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,57 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (leave empty to use .version file)'
11+
required: false
12+
type: string
713

814
permissions:
915
contents: write
16+
packages: write
17+
issues: write
1018

1119
jobs:
1220
release:
1321
runs-on: ubuntu-latest
1422
steps:
1523
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
1627
- name: Set up Go
1728
uses: actions/setup-go@v5
1829
with:
19-
go-version: "1.21"
30+
go-version: "1.24"
31+
32+
- name: Get version from file
33+
id: version
34+
run: |
35+
if [ -n "${{ github.event.inputs.version }}" ]; then
36+
VERSION="${{ github.event.inputs.version }}"
37+
elif [ -f ".version" ]; then
38+
VERSION="v$(cat .version)"
39+
else
40+
VERSION="${GITHUB_REF#refs/tags/}"
41+
fi
42+
echo "version=$VERSION" >> $GITHUB_OUTPUT
43+
echo "Using version: $VERSION"
44+
45+
- name: Create tag if needed
46+
if: github.event_name == 'workflow_dispatch'
47+
run: |
48+
VERSION="${{ steps.version.outputs.version }}"
49+
if ! git tag -l | grep -q "^$VERSION$"; then
50+
git tag -a "$VERSION" -m "Release $VERSION"
51+
git push origin "$VERSION"
52+
fi
53+
2054
- name: Run GoReleaser
21-
uses: goreleaser/goreleaser-action@v5
55+
uses: goreleaser/goreleaser-action@v6
2256
with:
23-
version: latest
57+
version: "~> v2"
2458
args: release --clean
2559
env:
2660
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,94 @@
1-
# If you prefer the allow list template instead of the deny list, see community template:
2-
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3-
#
1+
# Go Build Artifacts
42
# Binaries for programs and plugins
53
*.exe
64
*.exe~
75
*.dll
86
*.so
97
*.dylib
8+
openmorph
9+
openmorph.exe
1010

1111
# Test binary, built with `go test -c`
1212
*.test
1313

1414
# Code coverage profiles and other test artifacts
1515
*.out
16+
*.html
1617
coverage.*
1718
*.coverprofile
1819
profile.cov
19-
20-
# Dependency directories (remove the comment below to include it)
21-
# vendor/
20+
*.prof
2221

2322
# Go workspace file
2423
go.work
2524
go.work.sum
2625

27-
# env file
26+
# Environment and config files
2827
.env
28+
.env.local
29+
.env.production
30+
.env.staging
31+
32+
# Build and Release Artifacts
33+
dist/
34+
build/
35+
target/
36+
*.tar.gz
37+
*.zip
38+
*.deb
39+
*.rpm
40+
*.dmg
41+
*.pkg
42+
43+
# Backup files
44+
*.bak
45+
*.backup
46+
*.tmp
47+
*.swp
48+
*.swo
49+
*~
50+
51+
# OS specific files
52+
.DS_Store
53+
.DS_Store?
54+
._*
55+
.Spotlight-V100
56+
.Trashes
57+
ehthumbs.db
58+
Thumbs.db
59+
desktop.ini
60+
61+
# Editor/IDE files
62+
.idea/
63+
.vscode/
64+
*.sublime-project
65+
*.sublime-workspace
66+
.vim/
67+
.emacs.d/
68+
*~
69+
.#*
70+
\#*#
71+
72+
# Dependency directories
73+
vendor/
74+
node_modules/
75+
76+
# Test artifacts and cache
77+
.cache/
78+
.pytest_cache/
79+
.coverage
80+
htmlcov/
81+
82+
# Logs
83+
*.log
84+
logs/
85+
log/
86+
87+
# Temporary files
88+
tmp/
89+
temp/
90+
.tmp/
91+
.temp/
2992

30-
# Editor/IDE
31-
# .idea/
32-
# .vscode/
93+
# GoReleaser artifacts
94+
goreleaser.yaml.backup

.goreleaser.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
project_name: openmorph
23
builds:
34
- main: ./main.go
@@ -10,14 +11,12 @@ builds:
1011
- amd64
1112
- arm64
1213
ldflags:
13-
- -s -w -X 'main.version={{.Tag}}'
14+
- -s -w -X 'github.com/developerkunal/OpenMorph/cmd.version={{.Tag}}'
1415
archives:
15-
- format: tar.gz
16-
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
16+
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
1717
files:
1818
- LICENSE
1919
- README.md
20-
- "{{ .Binary }}*"
2120
changelog:
2221
sort: desc
2322
filters:
@@ -28,3 +27,37 @@ release:
2827
github:
2928
owner: developerkunal
3029
name: OpenMorph
30+
31+
# Homebrew tap
32+
brews:
33+
- name: openmorph
34+
homepage: "https://github.com/developerkunal/OpenMorph"
35+
description: "A tool for transforming and optimizing OpenAPI specifications"
36+
license: "MIT"
37+
repository:
38+
owner: developerkunal
39+
name: homebrew-openmorph
40+
branch: main
41+
commit_author:
42+
name: goreleaserbot
43+
email: bot@goreleaser.com
44+
directory: Formula
45+
test: |
46+
system "#{bin}/openmorph --version"
47+
install: |
48+
bin.install "openmorph"
49+
50+
# Scoop bucket
51+
scoops:
52+
- name: openmorph
53+
homepage: "https://github.com/developerkunal/OpenMorph"
54+
description: "A tool for transforming and optimizing OpenAPI specifications"
55+
license: "MIT"
56+
repository:
57+
owner: developerkunal
58+
name: scoop-openmorph
59+
branch: main
60+
commit_author:
61+
name: goreleaserbot
62+
email: bot@goreleaser.com
63+
directory: bucket

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)