Skip to content

Commit

Permalink
Merge pull request #586 from okp4/ci/manage-go-mod-versioning
Browse files Browse the repository at this point in the history
Ci/manage go mod versioning
  • Loading branch information
ccamel authored Mar 5, 2024
2 parents c7ed234 + 7a2cdb1 commit 9f896a2
Show file tree
Hide file tree
Showing 92 changed files with 190 additions and 161 deletions.
29 changes: 29 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@ plugins:
hasChanged: true
numMatches: 1
numReplacements: 1
- - "@semantic-release/exec"
- prepareCmd: |
major_version=$(cat version | cut -d. -f1)
if [ $major_version -gt 1 ]; then
module_name=$(go mod edit -json | jq -r '.Module.Path')
module_name_unversioned=$(echo ${module_name} | sed -E 's|/v[0-9]+$||')
module_name_versioned="${module_name_unversioned}/v${major_version}"
echo "🔬 major version detected, updating module path to ${module_name_versioned}"
go mod edit -module "${module_name_versioned}"
echo "✅ module name updated to ${module_name_versioned} in go.mod"
if [ "$(uname)" = "Darwin" ]; then
find . -type f -name "*.go" -exec \
sed -i '' "s|\"${module_name}|\"${module_name_versioned}|g" {} \;
else
find . -type f -name "*.go" -exec \
sed -i "s|\"${module_name}|\"${module_name_versioned}|g" {} \;
fi
echo "✅ packages updated to ${module_name_versioned} in source files"
echo "🧹 cleaning up go.sum"
go mod tidy
else
echo "🙅version is not greater than 1, no need to update module path"
fi
- - "@semantic-release/exec"
- prepareCmd: |
make release-assets
Expand All @@ -34,4 +60,7 @@ plugins:
- assets:
- CHANGELOG.md
- version
- go.mod
- go.sum
- "**/*.go"
message: "chore(release): perform release ${nextRelease.version}"
22 changes: 11 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,17 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

okp4wasm "github.com/okp4/okp4d/app/wasm"
"github.com/okp4/okp4d/docs"
logicmodule "github.com/okp4/okp4d/x/logic"
logicfs "github.com/okp4/okp4d/x/logic/fs"
logicmodulekeeper "github.com/okp4/okp4d/x/logic/keeper"
logicmoduletypes "github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/x/mint"
mintkeeper "github.com/okp4/okp4d/x/mint/keeper"
minttypes "github.com/okp4/okp4d/x/mint/types"
"github.com/okp4/okp4d/x/vesting"
vestingtypes "github.com/okp4/okp4d/x/vesting/types"
okp4wasm "github.com/okp4/okp4d/v7/app/wasm"
"github.com/okp4/okp4d/v7/docs"
logicmodule "github.com/okp4/okp4d/v7/x/logic"
logicfs "github.com/okp4/okp4d/v7/x/logic/fs"
logicmodulekeeper "github.com/okp4/okp4d/v7/x/logic/keeper"
logicmoduletypes "github.com/okp4/okp4d/v7/x/logic/types"
"github.com/okp4/okp4d/v7/x/mint"
mintkeeper "github.com/okp4/okp4d/v7/x/mint/keeper"
minttypes "github.com/okp4/okp4d/v7/x/mint/types"
"github.com/okp4/okp4d/v7/x/vesting"
vestingtypes "github.com/okp4/okp4d/v7/x/vesting/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"

"github.com/okp4/okp4d/app/params"
"github.com/okp4/okp4d/v7/app/params"
)

// makeEncodingConfig creates an EncodingConfig test configuration.
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app
import (
"fmt"

v7 "github.com/okp4/okp4d/app/upgrades/v7"
v7 "github.com/okp4/okp4d/v7/app/upgrades/v7"
)

// RegisterUpgradeHandlers registers the chain upgrade handlers.
Expand Down
4 changes: 2 additions & 2 deletions app/wasm/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

logickeeper "github.com/okp4/okp4d/x/logic/keeper"
logicwasm "github.com/okp4/okp4d/x/logic/wasm"
logickeeper "github.com/okp4/okp4d/v7/x/logic/keeper"
logicwasm "github.com/okp4/okp4d/v7/x/logic/wasm"
)

// customQuery represents the wasm custom query structure, it is intended to allow wasm contracts to execute queries
Expand Down
2 changes: 1 addition & 1 deletion client/credential/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
sdkerr "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx/signing"

"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/util"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion client/keys/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/version"

"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/util"
)

var flagPubKeyType = "type"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/keys"
cryptokeyring "github.com/cosmos/cosmos-sdk/crypto/keyring"

"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/util"
)

// KeyOutput is the output format for keys when listing them.
Expand Down
2 changes: 1 addition & 1 deletion cmd/okp4d/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/app"
"github.com/okp4/okp4d/v7/app"
)

func initSDKConfig() {
Expand Down
8 changes: 4 additions & 4 deletions cmd/okp4d/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"

"github.com/okp4/okp4d/app"
appparams "github.com/okp4/okp4d/app/params"
"github.com/okp4/okp4d/client/credential"
okp4keys "github.com/okp4/okp4d/client/keys"
"github.com/okp4/okp4d/v7/app"
appparams "github.com/okp4/okp4d/v7/app/params"
"github.com/okp4/okp4d/v7/client/credential"
okp4keys "github.com/okp4/okp4d/v7/client/keys"
)

// NewRootCmd creates a new root command for a Cosmos SDK application.
Expand Down
4 changes: 2 additions & 2 deletions cmd/okp4d/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

"github.com/okp4/okp4d/app"
"github.com/okp4/okp4d/cmd/okp4d/cmd"
"github.com/okp4/okp4d/v7/app"
"github.com/okp4/okp4d/v7/cmd/okp4d/cmd"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/okp4/okp4d
module github.com/okp4/okp4d/v7

go 1.21

Expand Down Expand Up @@ -45,6 +45,7 @@ require (
github.com/princjef/gomarkdoc v1.1.0
github.com/prometheus/client_golang v1.18.0
github.com/samber/lo v1.39.0
github.com/sergi/go-diff v1.3.1
github.com/smartystreets/goconvey v1.8.1
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
Expand Down Expand Up @@ -249,7 +250,6 @@ require (
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shengdoushi/base58 v1.0.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.2 // indirect
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_command_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra/doc"

"github.com/okp4/okp4d/cmd/okp4d/cmd"
"github.com/okp4/okp4d/v7/cmd/okp4d/cmd"
)

func generateCommandDocumentation() error {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

// GetQueryCmd returns the cli query commands for this module.
Expand Down
2 changes: 1 addition & 1 deletion x/logic/client/cli/query_ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/version"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

var program string
Expand Down
2 changes: 1 addition & 1 deletion x/logic/client/cli/query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func CmdQueryParams() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/fs/filtered_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/fs"
"net/url"

"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/util"
)

// FilteredFS is a wrapper around a fs.FS that filters out files that are not allowed to be read.
Expand Down
4 changes: 2 additions & 2 deletions x/logic/fs/filtered_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

. "github.com/smartystreets/goconvey/convey"

"github.com/okp4/okp4d/x/logic/testutil"
"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/testutil"
"github.com/okp4/okp4d/v7/x/logic/util"
)

func TestSourceFile(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/fs/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion x/logic/fs/wasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/testutil"
"github.com/okp4/okp4d/v7/x/logic/testutil"
)

func TestWasmHandler(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions x/logic/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/keeper"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/keeper"
"github.com/okp4/okp4d/v7/x/logic/types"
)

// InitGenesis initializes the module's state from a provided genesis state.
Expand Down
2 changes: 1 addition & 1 deletion x/logic/interpreter/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ichiban/prolog"
"github.com/ichiban/prolog/engine"

"github.com/okp4/okp4d/x/logic/predicate"
"github.com/okp4/okp4d/v7/x/logic/predicate"
)

// registry is a map from predicate names (in the form of "atom/arity") to predicates functions.
Expand Down
8 changes: 4 additions & 4 deletions x/logic/keeper/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/okp4/okp4d/x/logic"
"github.com/okp4/okp4d/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/x/logic/testutil"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic"
"github.com/okp4/okp4d/v7/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/v7/x/logic/testutil"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func TestFeatures(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/grpc_query.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package keeper

import (
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

var _ types.QueryServiceServer = Keeper{}
4 changes: 2 additions & 2 deletions x/logic/keeper/grpc_query_ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/meter"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/meter"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (response *types.QueryServiceAskResponse, err error) {
Expand Down
8 changes: 4 additions & 4 deletions x/logic/keeper/grpc_query_ask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/okp4/okp4d/x/logic"
"github.com/okp4/okp4d/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/x/logic/testutil"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic"
"github.com/okp4/okp4d/v7/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/v7/x/logic/testutil"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func TestGRPCAsk(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/grpc_query_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func (k Keeper) Params(c context.Context, req *types.QueryServiceParamsRequest) (*types.QueryServiceParamsResponse, error) {
Expand Down
8 changes: 4 additions & 4 deletions x/logic/keeper/grpc_query_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/okp4/okp4d/x/logic"
"github.com/okp4/okp4d/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/x/logic/testutil"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic"
"github.com/okp4/okp4d/v7/x/logic/keeper"
logictestutil "github.com/okp4/okp4d/v7/x/logic/testutil"
"github.com/okp4/okp4d/v7/x/logic/types"
)

func TestGRPCParams(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions x/logic/keeper/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/fs"
"github.com/okp4/okp4d/x/logic/interpreter"
"github.com/okp4/okp4d/x/logic/interpreter/bootstrap"
"github.com/okp4/okp4d/x/logic/meter"
prolog2 "github.com/okp4/okp4d/x/logic/prolog"
"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/x/logic/util"
"github.com/okp4/okp4d/v7/x/logic/fs"
"github.com/okp4/okp4d/v7/x/logic/interpreter"
"github.com/okp4/okp4d/v7/x/logic/interpreter/bootstrap"
"github.com/okp4/okp4d/v7/x/logic/meter"
prolog2 "github.com/okp4/okp4d/v7/x/logic/prolog"
"github.com/okp4/okp4d/v7/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/util"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

type FSProvider = func(ctx goctx.Context) fs.FS
Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/okp4/okp4d/x/logic/types"
"github.com/okp4/okp4d/v7/x/logic/types"
)

type msgServer struct {
Expand Down
Loading

0 comments on commit 9f896a2

Please sign in to comment.