Skip to content

Commit 2220da9

Browse files
author
Developer Experience team at Ignite
committed
Initialized with Ignite CLI
0 parents  commit 2220da9

32 files changed

+6681
-0
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow is useful if you want to automate the process of:
2+
#
3+
# a) Creating a new prelease when you push a new tag with a "v" prefix (version).
4+
#
5+
# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases.
6+
# After the prerelease is created, you need to make your changes on the release page at the relevant
7+
# Github page and publish your release.
8+
#
9+
# b) Creating/updating the "latest" prerelease when you push to your default branch.
10+
#
11+
# This type of prelease is useful to make your bleeding-edge binaries available to advanced users.
12+
#
13+
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
14+
# default branch.
15+
on: push
16+
17+
jobs:
18+
might_release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Prepare Release Variables
27+
id: vars
28+
uses: ignite/cli/actions/release/vars@main
29+
30+
- name: Issue Release Assets
31+
uses: ignite/cli/actions/cli@main
32+
if: ${{ steps.vars.outputs.should_release == 'true' }}
33+
with:
34+
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 -y
35+
env:
36+
DO_NOT_TRACK: 1
37+
GOFLAGS: "-buildvcs=false"
38+
39+
- name: Delete the "latest" Release
40+
uses: dev-drprasad/delete-tag-and-release@v0.2.1
41+
if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }}
42+
with:
43+
tag_name: ${{ steps.vars.outputs.tag_name }}
44+
delete_release: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Publish the Release
49+
uses: softprops/action-gh-release@v1
50+
if: ${{ steps.vars.outputs.should_release == 'true' }}
51+
with:
52+
tag_name: ${{ steps.vars.outputs.tag_name }}
53+
files: release/*
54+
prerelease: true
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
vue/node_modules
2+
vue/dist
3+
release/
4+
.idea/
5+
.vscode/
6+
.DS_Store
7+
*.dot
8+
*.log
9+
*.ign

Makefile

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
2+
COMMIT := $(shell git log -1 --format='%H')
3+
APPNAME := junction
4+
5+
# do not override user values
6+
ifeq (,$(VERSION))
7+
VERSION := $(shell git describe --exact-match 2>/dev/null)
8+
# if VERSION is empty, then populate it with branch name and raw commit hash
9+
ifeq (,$(VERSION))
10+
VERSION := $(BRANCH)-$(COMMIT)
11+
endif
12+
endif
13+
14+
# Update the ldflags with the app, client & server names
15+
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(APPNAME) \
16+
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME)d \
17+
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
18+
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
19+
20+
BUILD_FLAGS := -ldflags '$(ldflags)'
21+
22+
##############
23+
### Test ###
24+
##############
25+
26+
test-unit:
27+
@echo Running unit tests...
28+
@go test -mod=readonly -v -timeout 30m ./...
29+
30+
test-race:
31+
@echo Running unit tests with race condition reporting...
32+
@go test -mod=readonly -v -race -timeout 30m ./...
33+
34+
test-cover:
35+
@echo Running unit tests and creating coverage report...
36+
@go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic ./...
37+
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
38+
@rm $(COVER_FILE)
39+
40+
bench:
41+
@echo Running unit tests with benchmarking...
42+
@go test -mod=readonly -v -timeout 30m -bench=. ./...
43+
44+
test: govet govulncheck test-unit
45+
46+
.PHONY: test test-unit test-race test-cover bench
47+
48+
#################
49+
### Install ###
50+
#################
51+
52+
all: install
53+
54+
install:
55+
@echo "--> ensure dependencies have not been modified"
56+
@go mod verify
57+
@echo "--> installing $(APPNAME)d"
58+
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/$(APPNAME)d
59+
60+
.PHONY: all install
61+
62+
##################
63+
### Protobuf ###
64+
##################
65+
66+
# Use this target if you do not want to use Ignite for generating proto files
67+
68+
proto-deps:
69+
@echo "Installing proto deps"
70+
@echo "Proto deps present, run 'go tool' to see them"
71+
72+
proto-gen:
73+
@echo "Generating protobuf files..."
74+
@ignite generate proto-go --yes
75+
76+
.PHONY: proto-gen
77+
78+
#################
79+
### Linting ###
80+
#################
81+
82+
lint:
83+
@echo "--> Running linter"
84+
@go tool github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --timeout 15m
85+
86+
lint-fix:
87+
@echo "--> Running linter and fixing issues"
88+
@go tool github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix --timeout 15m
89+
90+
.PHONY: lint lint-fix
91+
92+
###################
93+
### Development ###
94+
###################
95+
96+
govet:
97+
@echo Running go vet...
98+
@go vet ./...
99+
100+
govulncheck:
101+
@echo Running govulncheck...
102+
@go tool golang.org/x/vuln/cmd/govulncheck@latest
103+
@govulncheck ./...
104+
105+
.PHONY: govet govulncheck

0 commit comments

Comments
 (0)