-
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
0 parents
commit 26edf26
Showing
5 changed files
with
143 additions
and
0 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,60 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
create-release: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') # Only run this job when a valid tag is pushed | ||
steps: | ||
- name: Check if tag exists | ||
id: check_tag | ||
run: | | ||
if [ -n "$GITHUB_REF" ]; then | ||
TAG=${GITHUB_REF#refs/tags/} | ||
# echo "::set-output name=tag::$TAG" | ||
echo "TAG=${TAG}" >> $GITHUB_ENV | ||
else | ||
# echo "::set-output name=tag::" | ||
echo "TAG=" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# tag_name: ${{ steps.check_tag.outputs.tag }} | ||
tag_name: ${{ env.TAG }} | ||
body: | | ||
:gem: released new version ${{ env.TAG }} | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# vscode | ||
.vscode/settings.json | ||
.vscode/extensions.json | ||
|
||
# GoLand | ||
.idea | ||
|
||
# MacOS | ||
.DS_Store | ||
|
||
# Main | ||
main.go | ||
|
||
# Logs | ||
logs/ | ||
logs |
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,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Package", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "${workspaceFolder}/main.go" | ||
} | ||
] | ||
} |
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,27 @@ | ||
.PHONY: run build test tidy deps-upgrade deps-clean-cache | ||
|
||
# ============================================================================== | ||
# Start Rest | ||
run: | ||
go run ./cmd/main.go | ||
|
||
build: | ||
go build .cmd/main.go | ||
|
||
# ============================================================================== | ||
# Modules support | ||
test: | ||
go test -cover ./... | ||
|
||
tidy: | ||
go mod tidy | ||
go mod vendor | ||
|
||
deps-upgrade: | ||
# go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all) | ||
go get -u -t -d -v ./... | ||
go mod tidy | ||
go mod vendor | ||
|
||
deps-clean-cache: | ||
go clean -modcache |
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,3 @@ | ||
module github.com/sivaosorg/db.resolver | ||
|
||
go 1.20 |