-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
756aa21
commit 46a45e1
Showing
12 changed files
with
259 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{{ range .Versions }} | ||
<a name="{{ .Tag.Name }}"></a> | ||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) | ||
|
||
{{ range .CommitGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Commits -}} | ||
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .RevertCommits -}} | ||
### Reverts | ||
|
||
{{ range .RevertCommits -}} | ||
* {{ .Revert.Header }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .MergeCommits -}} | ||
### Pull Requests | ||
|
||
{{ range .MergeCommits -}} | ||
* {{ .Header }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .NoteGroups -}} | ||
{{ range .NoteGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Notes }} | ||
{{ .Body }} | ||
{{ end }} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
style: github | ||
template: CHANGELOG.tpl.md | ||
info: | ||
title: CHANGELOG | ||
repository_url: https://github.com/deweysasser/golang-program | ||
options: | ||
commits: | ||
# filters: | ||
# Type: | ||
# - feat | ||
# - fix | ||
# - perf | ||
# - refactor | ||
commit_groups: | ||
# title_maps: | ||
# feat: Features | ||
# fix: Bug Fixes | ||
# perf: Performance Improvements | ||
# refactor: Code Refactoring | ||
header: | ||
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" | ||
pattern_maps: | ||
- Type | ||
- Scope | ||
- Subject | ||
notes: | ||
keywords: | ||
- BREAKING CHANGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
name: Build | ||
env: | ||
GO_VERSION: 1.23 | ||
|
||
jobs: | ||
build: | ||
name: Run checks and build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{env.GO_VERSION}} | ||
|
||
- name: Vet | ||
run: make vet | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build | ||
run: make | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{env.GO_VERSION}} | ||
|
||
- run: go fmt ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Release | ||
# on: | ||
# push: | ||
# tags: [ v* ] | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
env: | ||
GO_VERSION: 1.23 | ||
REPO: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
GOOS: [linux, darwin, windows] | ||
GOARCH: [amd64, arm64] | ||
include: | ||
- GOOS: windows | ||
ext: .exe | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Repo Name | ||
id: repo-name | ||
run: echo name=$(basename ${{ github.repository }}) >> $GITHUB_OUTPUT | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
- name: Build | ||
run: make package PROGRAM=${{ env.GOOS }}-${{ env.GOARCH }}/${{ steps.repo-name.outputs.name }}${{ matrix.ext }} PACKAGE=dist/${{ steps.repo-name.outputs.name }}-${{ matrix.GOOS }}-${{ matrix.GOARCH }}.zip | ||
env: | ||
GOOS: ${{ matrix.GOOS }} | ||
GOARCH: ${{ matrix.GOARCH }} | ||
|
||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts-${{ matrix.GOOS }}-${{ matrix.GOARCH }} | ||
path: dist | ||
retention-days: 1 | ||
if-no-files-found: error | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
pattern: artifacts-* | ||
merge-multiple: true | ||
|
||
- name: Install ChangeLog generator | ||
run: | | ||
wget https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_linux_amd64.tar.gz | ||
tar xzf git-chglog*.tar.gz git-chglog | ||
- name: "Get Last Release" | ||
id: last_release | ||
uses: InsonusK/[email protected] | ||
with: | ||
myToken: ${{ github.token }} | ||
exclude_types: "draft|prerelease" | ||
|
||
- name: Generate Changelog for ${{ github.ref_name }} | ||
id: generate-changelog | ||
run: PATH="${PATH}:." make CHANGELOG.md | ||
|
||
- name: Generate checksum | ||
run: | | ||
cd artifacts | ||
for file in *; do shasum -a 256 "$file" >> checksum.txt; done | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
./artifacts/* | ||
body_path: ./CHANGELOG.md | ||
draft: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ func ConnectDB() { | |
|
||
file.WriteString(content) | ||
fmt.Println("Config file created successfully!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
/* | ||
Copyright © 2024 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package main | ||
|
||
import ( | ||
"Utkarsh4517/ginister/cmd" | ||
|
||
) | ||
|
||
func main() { | ||
cmd.Execute() | ||
// config.ConnectDB() | ||
// router := routes.SetupRouter() | ||
|
||
// router.Run(":8080") | ||
// router.Run(":8080") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ func SetupRouter() *gin.Engine { | |
|
||
file.WriteString(content) | ||
fmt.Println("Routes file created successfully!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package start | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
func CreateMainFile(projectDir string) error { | ||
content := `package main | ||
import ( | ||
"github.com/gin-gonic/gin" | ||
) | ||
func main() { | ||
r := gin.Default() | ||
r.Run(":8080") | ||
} | ||
` | ||
|
||
filePath := fmt.Sprintf("%s/main.go", projectDir) | ||
file, err := os.Create(filePath) | ||
if err != nil { | ||
return err | ||
} | ||
defer file.Close() | ||
|
||
_, err = file.WriteString(content) | ||
return err | ||
} |