From 7e3114456269055b7655ce0395b3c709dc65cb53 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 17 Oct 2022 16:55:13 +0700 Subject: [PATCH 001/106] automate post-upgrade tasks by code generating upgrade handler and setting e2e in makefile --- scripts/empty_upgrade_handler_gen.sh | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/empty_upgrade_handler_gen.sh diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh new file mode 100644 index 00000000000..9fe8df72761 --- /dev/null +++ b/scripts/empty_upgrade_handler_gen.sh @@ -0,0 +1,43 @@ +#!/bin/bash + + echo "Creating a new empty upgrade handler" + + latest_version=0 + for f in app/upgrades/*; do + s_f=(${f//// }) + version=${s_f[2]} + num_version=${version//[!0-9]/} + if [[ $num_version -gt $latest_version ]]; then + latest_version=$num_version + fi + done + + version_create=$((latest_version+1)) + new_file=./app/upgrades/v${version_create} + + mkdir $new_file + + touch $new_file/constants.go + touch $new_file/upgrades.go + + module=$(go mod edit -json | jq ".Module.Path") + module=${module%?} + path=${module%???} + + cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go + cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go + + sed -i '' "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed -i '' "s/v$latest_version/v$version_create/g" $new_file/upgrades.go + + bracks='"' + + # change imports in case go mod changed + sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -i '' "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -i '' "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + + # change e2e version in makefile + echo E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks + sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From e4c59012e85cff30bb1891ee5c3ce45ae02b6d89 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 17 Oct 2022 16:56:18 +0700 Subject: [PATCH 002/106] automate post-upgrade tasks by code generating upgrade handler and setting e2e in makefile --- .github/workflows/auto-gen-upgrade-handler-e2e.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/auto-gen-upgrade-handler-e2e.yml diff --git a/.github/workflows/auto-gen-upgrade-handler-e2e.yml b/.github/workflows/auto-gen-upgrade-handler-e2e.yml new file mode 100644 index 00000000000..6a5ba7ace52 --- /dev/null +++ b/.github/workflows/auto-gen-upgrade-handler-e2e.yml @@ -0,0 +1,11 @@ +name: Create Update Handler +run-name: ${{ github.actor }} is updating version +on: [push] +jobs: + Create-Pull-Request: + runs-on: ubuntu-latest + steps: + - runs: git add Makefile + - runs: git add app/upgrades + - runs: git commit -m "successfully initiated upgrade handler" + - runs: git push https://github.com/RusAkh/osmosis-fork/tree/main \ No newline at end of file From 5965c1a33e499ccb80a03db0e598ae8e73a96408 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 18 Oct 2022 12:33:25 +0700 Subject: [PATCH 003/106] save --- scripts/empty_upgrade_handler_gen.sh | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 scripts/empty_upgrade_handler_gen.sh diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh old mode 100644 new mode 100755 index 9fe8df72761..cff4cc89308 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -39,5 +39,4 @@ sed -i '' "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change e2e version in makefile - echo E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From b4bface6d54ebba5fb4500e67d0d2595a3c907ed Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 18 Oct 2022 12:36:21 +0700 Subject: [PATCH 004/106] save --- .github/workflows/auto-update-upgrade.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/auto-update-upgrade.yml diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml new file mode 100644 index 00000000000..9307c7252d3 --- /dev/null +++ b/.github/workflows/auto-update-upgrade.yml @@ -0,0 +1,12 @@ +name: On release auto upgrade + +on: + release: + types: [created] + +jobs: + build: + name: Creating new upgrade handler and updating e2e in makefile + runs-on: ubuntu-latest + steps: + run: ./scripts/empty_upgrade_handler_gen.sh \ No newline at end of file From 153105054b230953bb2422242ed582658c84db1a Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 18 Oct 2022 12:38:37 +0700 Subject: [PATCH 005/106] save --- .github/workflows/auto-gen-upgrade-handler-e2e.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/workflows/auto-gen-upgrade-handler-e2e.yml diff --git a/.github/workflows/auto-gen-upgrade-handler-e2e.yml b/.github/workflows/auto-gen-upgrade-handler-e2e.yml deleted file mode 100644 index 6a5ba7ace52..00000000000 --- a/.github/workflows/auto-gen-upgrade-handler-e2e.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Create Update Handler -run-name: ${{ github.actor }} is updating version -on: [push] -jobs: - Create-Pull-Request: - runs-on: ubuntu-latest - steps: - - runs: git add Makefile - - runs: git add app/upgrades - - runs: git commit -m "successfully initiated upgrade handler" - - runs: git push https://github.com/RusAkh/osmosis-fork/tree/main \ No newline at end of file From 1783366c2c8e5d80b592ee43f85b0a316e36bd23 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 18 Oct 2022 16:30:37 +0700 Subject: [PATCH 006/106] yaml --- .github/workflows/auto-update-upgrade.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 9307c7252d3..309e165d208 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -6,7 +6,23 @@ on: jobs: build: - name: Creating new upgrade handler and updating e2e in makefile runs-on: ubuntu-latest steps: - run: ./scripts/empty_upgrade_handler_gen.sh \ No newline at end of file + - uses: actions/checkout@v3 + # - run: git checkout HEAD^ + - run: bash ./scripts/empty_upgrade_handler_gen.sh + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + token: https://github.com/RusAkh/osmosis-fork + commit-message: Auto post release updgrade + delete-branch: true + branch: main + body: | + Update report + - Created a new empty upgrade handler + - Increased E2E_UPGRADE_VERSION in Makefile by 1 + labels: | + auto + e2e + app-wiring \ No newline at end of file From 480931dbe5370a3739662cfb00162aa791586376 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 18 Oct 2022 16:52:52 +0700 Subject: [PATCH 007/106] save --- .github/workflows/auto-update-upgrade.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 309e165d208..0874e281039 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,7 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - run: git checkout HEAD^ - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From d7058419e3dd45158f7323f239c612694bd46890 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 11:44:52 +0700 Subject: [PATCH 008/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 0874e281039..c9ed021ebc9 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -1,8 +1,8 @@ -name: On release auto upgrade +name: On Release Auto Upgrade on: release: - types: [created] + types: [published] jobs: build: From e39aa1e4412cecffc030a4b073a2b83a3a900451 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 11:46:11 +0700 Subject: [PATCH 009/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index c9ed021ebc9..69fcb6c7a9e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -2,7 +2,7 @@ name: On Release Auto Upgrade on: release: - types: [published] + types: [deleted] jobs: build: From 335e34a350a33187569ea4c429ec160584985bf0 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 11:54:26 +0700 Subject: [PATCH 010/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 69fcb6c7a9e..d817125bbf4 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -2,7 +2,7 @@ name: On Release Auto Upgrade on: release: - types: [deleted] + types: [created] jobs: build: From 94546ff23d31f668f85a0eabdf0931036e0afe4b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:07:44 +0700 Subject: [PATCH 011/106] save --- Makefile'' | 422 +++++++++++++++++++++++++++ scripts/empty_upgrade_handler_gen.sh | 19 +- 2 files changed, 434 insertions(+), 7 deletions(-) create mode 100644 Makefile'' diff --git a/Makefile'' b/Makefile'' new file mode 100644 index 00000000000..5d4a5261e1d --- /dev/null +++ b/Makefile'' @@ -0,0 +1,422 @@ +#!/usr/bin/make -f + +VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +COMMIT := $(shell git log -1 --format='%H') +LEDGER_ENABLED ?= true +SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') +GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) +DOCKER := $(shell which docker) +BUILDDIR ?= $(CURDIR)/build +E2E_UPGRADE_VERSION := "v13" + + +export GO111MODULE = on + +# process build tags + +build_tags = netgo +ifeq ($(LEDGER_ENABLED),true) + ifeq ($(OS),Windows_NT) + GCCEXE = $(shell where gcc.exe 2> NUL) + ifeq ($(GCCEXE),) + $(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) + else + build_tags += ledger + endif + else + UNAME_S = $(shell uname -s) + ifeq ($(UNAME_S),OpenBSD) + $(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) + else + GCC = $(shell command -v gcc 2> /dev/null) + ifeq ($(GCC),) + $(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) + else + build_tags += ledger + endif + endif + endif +endif + +ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) + build_tags += gcc +else ifeq (rocksdb,$(findstring rocksdb,$(OSMOSIS_BUILD_OPTIONS))) + build_tags += gcc +endif +build_tags += $(BUILD_TAGS) +build_tags := $(strip $(build_tags)) + +whitespace := +whitespace += $(whitespace) +comma := , +build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) + +# process linker flags + +ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=osmosis \ + -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ + -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ + -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" + +ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb +else ifeq (rocksdb,$(findstring rocksdb,$(OSMOSIS_BUILD_OPTIONS))) + ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=rocksdb +endif +ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) + ldflags += -w -s +endif +ifeq ($(LINK_STATICALLY),true) + ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" +endif +ldflags += $(LDFLAGS) +ldflags := $(strip $(ldflags)) + +BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' +# check for nostrip option +ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) + BUILD_FLAGS += -trimpath +endif + +############################################################################### +### Build ### +############################################################################### + +all: install lint test + +BUILD_TARGETS := build install + +build: BUILD_ARGS=-o $(BUILDDIR)/ + +$(BUILD_TARGETS): go.sum $(BUILDDIR)/ + go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... + +$(BUILDDIR)/: + mkdir -p $(BUILDDIR)/ + +# Cross-building for arm64 from amd64 (or viceversa) takes +# a lot of time due to QEMU virtualization but it's the only way (afaik) +# to get a statically linked binary with CosmWasm + +build-reproducible: build-reproducible-amd64 build-reproducible-arm64 + +build-reproducible-amd64: go.sum $(BUILDDIR)/ + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --platform linux/amd64 \ + -t osmosis-amd64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-amd64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 + $(DOCKER) rm -f osmobinary + +build-reproducible-arm64: go.sum $(BUILDDIR)/ + $(DOCKER) buildx create --name osmobuilder || true + $(DOCKER) buildx use osmobuilder + $(DOCKER) buildx build \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --platform linux/arm64 \ + -t osmosis-arm64 \ + --load \ + -f Dockerfile . + $(DOCKER) rm -f osmobinary || true + $(DOCKER) create -ti --name osmobinary osmosis-arm64 + $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 + $(DOCKER) rm -f osmobinary + +build-linux: go.sum + LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build + +build-contract-tests-hooks: + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests + +go-mod-cache: go.sum + @echo "--> Download go modules to local cache" + @go mod download + +go.sum: go.mod + @echo "--> Ensure dependencies have not been modified" + @go mod verify + +draw-deps: + @# requires brew install graphviz or apt-get install graphviz + go get github.com/RobotsAndPencils/goviz + @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png + +clean: + rm -rf $(CURDIR)/artifacts/ + +distclean: clean + rm -rf vendor/ + +############################################################################### +### Proto ### +############################################################################### + +proto-all: proto-format proto-gen + +proto: + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/protocgen.sh + @echo + @echo "=========== Generate Complete ============" + @echo + +test: + @go test -v ./x/... + +docs: + @echo + @echo "=========== Generate Message ============" + @echo + ./scripts/generate-docs.sh + + statik -src=client/docs/static -dest=client/docs -f -m + @if [ -n "$(git status --porcelain)" ]; then \ + echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ + exit 1;\ + else \ + echo "\033[92mSwagger docs are in sync\033[0m";\ + fi + @echo + @echo "=========== Generate Complete ============" + @echo +.PHONY: docs + +protoVer=v0.8 +protoImageName=osmolabs/osmo-proto-gen:$(protoVer) +containerProtoGen=cosmos-sdk-proto-gen-$(protoVer) +containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer) + +proto-gen: + @echo "Generating Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ + sh ./scripts/protocgen.sh; fi + +proto-format: + @echo "Formatting Protobuf files" + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ + find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi + +proto-image-build: + @DOCKER_BUILDKIT=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto + +proto-image-push: + docker push $(protoImageName) + +############################################################################### +### Querygen ### +############################################################################### + +run-querygen: + @go run cmd/querygen/main.go + +############################################################################### +### Tests & Simulation ### +############################################################################### + +PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e') +PACKAGES_E2E=$(shell go list -tags e2e ./... | grep '/e2e') +PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator') +TEST_PACKAGES=./... + +test: test-unit test-build + +test-all: check test-race test-cover + +test-unit: + @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) + +test-race: + @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) + +test-cover: + @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) + +test-sim-suite: + @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) + +test-sim-app: + @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) + +test-sim-determinism: + @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) + +test-sim-bench: + @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) + +# test-e2e runs a full e2e test suite +# deletes any pre-existing Osmosis containers before running. +# +# Attempts to delete Docker resources at the end. +# May fail to do so if stopped mid way. +# In that case, run `make e2e-remove-resources` +# manually. +# Utilizes Go cache. +test-e2e: e2e-setup test-e2e-ci + +# test-e2e-ci runs a full e2e test suite +# does not do any validation about the state of the Docker environment +# As a result, avoid using this locally. +test-e2e-ci: + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) + +# test-e2e-debug runs a full e2e test suite but does +# not attempt to delete Docker resources at the end. +test-e2e-debug: e2e-setup + @VERSION=$(VERSION) OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + +# test-e2e-short runs the e2e test with only short tests. +# Does not delete any of the containers after running. +# Deletes any existing containers before running. +# Does not use Go cache. +test-e2e-short: e2e-setup + @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 + +test-mutation: + @bash scripts/mutation-test.sh $(MODULES) + +benchmark: + @go test -mod=readonly -bench=. $(PACKAGES_UNIT) + +build-e2e-script: + mkdir -p $(BUILDDIR) + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) + +docker-build-debug: + @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . + @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug + +docker-build-e2e-init-chain: + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . + +docker-build-e2e-init-node: + @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . + +e2e-setup: e2e-check-image-sha e2e-remove-resources + @echo Finished e2e environment setup, ready to start the test + +e2e-check-image-sha: + tests/e2e/scripts/run/check_image_sha.sh + +e2e-remove-resources: + tests/e2e/scripts/run/remove_stale_resources.sh + +.PHONY: test-mutation + +############################################################################### +### Docker ### +############################################################################### + +RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static +RUNNER_BASE_IMAGE_ALPINE := alpine:3.16 +RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static:nonroot + +docker-build: + @DOCKER_BUILDKIT=1 docker build \ + -t osmosis:local \ + -t osmosis:local-distroless \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + +docker-build-distroless: docker-build + +docker-build-alpine: + @DOCKER_BUILDKIT=1 docker build \ + -t osmosis:local-alpine \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + +docker-build-nonroot: + @DOCKER_BUILDKIT=1 docker build \ + -t osmosis:local-nonroot \ + --build-arg GO_VERSION=$(GO_VERSION) \ + --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_NONROOT) \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . + +############################################################################### +### Linting ### +############################################################################### + +lint: + @echo "--> Running linter" + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + +format: + @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix + @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + +mdlint: + @echo "--> Running markdown linter" + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" + +markdown: + @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + +############################################################################### +### Localnet ### +############################################################################### + +localnet-keys: + . tests/localosmosis/scripts/add_keys.sh + +localnet-init: localnet-clean localnet-build + +localnet-build: + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build + +localnet-start: + @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml up + +localnet-start-with-state: + @STATE=-s docker-compose -f tests/localosmosis/docker-compose.yml up + +localnet-startd: + @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml up -d + +localnet-startd-with-state: + @STATE=-s docker-compose -f tests/localosmosis/docker-compose.yml up -d + +localnet-stop: + @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml down + +localnet-clean: + @rm -rfI $(HOME)/.osmosisd/ + +localnet-state-export-init: localnet-state-export-clean localnet-state-export-build + +localnet-state-export-build: + @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml build + +localnet-state-export-start: + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up + +localnet-state-export-startd: + @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d + +localnet-state-export-stop: + @docker-compose -f tests/localosmosis/docker-compose.yml down + +localnet-state-export-clean: localnet-clean + +.PHONY: all build-linux install format lint \ + go-mod-cache draw-deps clean build build-contract-tests-hooks \ + test test-all test-build test-cover test-unit test-race benchmark diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index cff4cc89308..40bc2d3fce4 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -27,16 +27,21 @@ cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go - sed -i '' "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed -i '' "s/v$latest_version/v$version_create/g" $new_file/upgrades.go +SEDOPTION= +if [[ "$OSTYPE" == "darwin"* ]]; then + SEDOPTION="-i ''" +fi + + sed $SEDOPTION "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed $SEDOPTION "s/v$latest_version/v$version_create/g" $new_file/upgrades.go bracks='"' # change imports in case go mod changed - sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -i '' "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -i '' "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + sed $SEDOPTION "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed $SEDOPTION "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed $SEDOPTION "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed $SEDOPTION "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change e2e version in makefile - sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed $SEDOPTION "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From cbd2a7eabaec6811b917c2f414ee1adc161ee844 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:14:54 +0700 Subject: [PATCH 012/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index d817125bbf4..69fcb6c7a9e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -2,7 +2,7 @@ name: On Release Auto Upgrade on: release: - types: [created] + types: [deleted] jobs: build: From 9a82b4f3bc0b3f09fa649646a868f30df0f43d17 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:16:12 +0700 Subject: [PATCH 013/106] save --- .github/workflows/auto-update-upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 69fcb6c7a9e..7723053ddd2 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From 1c3571a73d03aa5d08a98150e790ef548090f744 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:19:45 +0700 Subject: [PATCH 014/106] save --- .github/workflows/auto-update-upgrade.yml | 3 ++- scripts/empty_upgrade_handler_gen.sh | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 7723053ddd2..b1b4328ca42 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -2,13 +2,14 @@ name: On Release Auto Upgrade on: release: - types: [deleted] + types: [published] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: echo CHECKING LS - run: ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 40bc2d3fce4..260bffc72c6 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -1,7 +1,5 @@ #!/bin/bash - echo "Creating a new empty upgrade handler" - latest_version=0 for f in app/upgrades/*; do s_f=(${f//// }) From d1d194d6b75b2d46d943c4ca14734809ce3d259b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:21:57 +0700 Subject: [PATCH 015/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b1b4328ca42..91ae999916e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -2,7 +2,7 @@ name: On Release Auto Upgrade on: release: - types: [published] + types: [deleted] jobs: build: From 39828115b0637e725f655a67d80b7374a745eb9a Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:26:35 +0700 Subject: [PATCH 016/106] save --- .github/workflows/auto-update-upgrade.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 91ae999916e..7f65bd6ec55 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,9 +8,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - run: echo CHECKING LS - - run: ls -la + - uses: actions/checkout@v2 + - name: CHECK + run: | + echo CHECKIG LS + ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v4 From 5eb4c2cf1f36f322f029e6767c12dc1731c1c635 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 12:43:43 +0700 Subject: [PATCH 017/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 7f65bd6ec55..84d3e9da34d 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v2 - name: CHECK run: | - echo CHECKIG LS + echo CHECKIG LSs ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request From 119ec82ee8d08b58078fef8a37e43b6521be0ba2 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:15:23 +0700 Subject: [PATCH 018/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 84d3e9da34d..a5e3267eac1 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: CHECK run: | echo CHECKIG LSs From 3a32fb8b9ae7155c16437892dd417963f0924f95 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:28:12 +0700 Subject: [PATCH 019/106] save --- .github/workflows/auto-update-upgrade.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index a5e3267eac1..44c7e19c72a 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -28,4 +28,5 @@ jobs: labels: | auto e2e - app-wiring \ No newline at end of file + app-wiring + base: ${{ github.head_ref }} \ No newline at end of file From dca5d4ac2473913a540a3d678c56a0799d2a43b8 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:31:19 +0700 Subject: [PATCH 020/106] save --- .github/workflows/auto-update-upgrade.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 44c7e19c72a..cf1b6026906 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,6 +12,8 @@ jobs: - name: CHECK run: | echo CHECKIG LSs + echo ${{ github.head_ref }} + echo ${{ github.token }} ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create Pull Request From eb4aa0928051147e9588ea73261e3a1f9d642f60 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:38:12 +0700 Subject: [PATCH 021/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index cf1b6026906..9e7268912e2 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ jobs: - name: CHECK run: | echo CHECKIG LSs - echo ${{ github.head_ref }} + echo ${{ github.RusAkh/osmosis-fork }} echo ${{ github.token }} ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -31,4 +31,4 @@ jobs: auto e2e app-wiring - base: ${{ github.head_ref }} \ No newline at end of file + base: ${{ github.RusAkh/osmosis-fork }} \ No newline at end of file From 999647a0b8f3547853bb95f98d0af63d5f09313b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:40:42 +0700 Subject: [PATCH 022/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 9e7268912e2..dc681e8a18c 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ jobs: - name: CHECK run: | echo CHECKIG LSs - echo ${{ github.RusAkh/osmosis-fork }} + echo ${{ github.repository }} echo ${{ github.token }} ls -la - run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -31,4 +31,4 @@ jobs: auto e2e app-wiring - base: ${{ github.RusAkh/osmosis-fork }} \ No newline at end of file + base: ${{ github.repository }} \ No newline at end of file From 9a1dec9e75be9fe9ac45a4a38e894d23b22fee1f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:41:19 +0700 Subject: [PATCH 023/106] save --- .github/workflows/auto-update-upgrade.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index dc681e8a18c..2e79b172340 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -1,9 +1,9 @@ name: On Release Auto Upgrade -on: - release: - types: [deleted] - +# on: +# release: +# types: [deleted] +on: [push] jobs: build: runs-on: ubuntu-latest @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - name: CHECK run: | - echo CHECKIG LSs + echo CHECKIG LSss echo ${{ github.repository }} echo ${{ github.token }} ls -la From 015e73535236ee955049b5fa0f2af74a544c1ac5 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:52:02 +0700 Subject: [PATCH 024/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 2e79b172340..9204c0017fb 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - name: CHECK run: | - echo CHECKIG LSss + echo CHECKIG LSssa echo ${{ github.repository }} echo ${{ github.token }} ls -la From 62a103f41464ad51221337416d7c663ce1c11df7 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:55:28 +0700 Subject: [PATCH 025/106] save --- .github/workflows/auto-update-upgrade.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 9204c0017fb..f35ef1def40 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.ACCESS_TOKEN }} - name: CHECK run: | echo CHECKIG LSssa From 63b932e72b6f9b0bcbf123e6f003a9e61d1749bb Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 15:56:46 +0700 Subject: [PATCH 026/106] save --- .github/workflows/auto-update-upgrade.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index f35ef1def40..665ec14fbbf 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,9 +8,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.ACCESS_TOKEN }} + - uses: actions/checkout@v2.3.4 + # with: + # token: ${{ secrets.ACCESS_TOKEN }} - name: CHECK run: | echo CHECKIG LSssa From 78c44bb9d6802aba22baae923d2e047f212ec1bc Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:03:50 +0700 Subject: [PATCH 027/106] save --- .github/workflows/auto-update-upgrade.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 665ec14fbbf..e03206df469 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,20 +8,20 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 - # with: - # token: ${{ secrets.ACCESS_TOKEN }} + - name: Checkout + uses: actions/checkout@v2.3.4 + + - name: Running script + run: bash ./scripts/empty_upgrade_handler_gen.sh + - name: CHECK - run: | - echo CHECKIG LSssa - echo ${{ github.repository }} - echo ${{ github.token }} - ls -la - - run: bash ./scripts/empty_upgrade_handler_gen.sh + run: echo ${{ secrets.GITHUB_TOKEN }} + - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - token: https://github.com/RusAkh/osmosis-fork + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ github.repository }} commit-message: Auto post release updgrade delete-branch: true branch: main @@ -33,4 +33,3 @@ jobs: auto e2e app-wiring - base: ${{ github.repository }} \ No newline at end of file From 8981d1e4fc59948c699b22957cfa7c60cfcf7ebc Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:06:51 +0700 Subject: [PATCH 028/106] save --- .github/workflows/auto-update-upgrade.yml | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index e03206df469..4ff446d452d 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,17 +19,17 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ github.repository }} - commit-message: Auto post release updgrade - delete-branch: true - branch: main - body: | - Update report - - Created a new empty upgrade handler - - Increased E2E_UPGRADE_VERSION in Makefile by 1 - labels: | - auto - e2e - app-wiring + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # base: ${{ github.repository }} + # commit-message: Auto post release updgrade + # delete-branch: true + # branch: main + # body: | + # Update report + # - Created a new empty upgrade handler + # - Increased E2E_UPGRADE_VERSION in Makefile by 1 + # labels: | + # auto + # e2e + # app-wiring From b92b98745875120e13fa6136df7bc56534f6fde8 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:08:19 +0700 Subject: [PATCH 029/106] save --- .github/workflows/auto-update-upgrade.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 4ff446d452d..9a9ff9807f0 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -14,22 +14,19 @@ jobs: - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh - - name: CHECK - run: echo ${{ secrets.GITHUB_TOKEN }} - - name: Create Pull Request uses: peter-evans/create-pull-request@v4 - # with: + with: # token: ${{ secrets.GITHUB_TOKEN }} # base: ${{ github.repository }} # commit-message: Auto post release updgrade # delete-branch: true # branch: main - # body: | - # Update report - # - Created a new empty upgrade handler - # - Increased E2E_UPGRADE_VERSION in Makefile by 1 - # labels: | - # auto - # e2e - # app-wiring + body: | + Update report + - Created a new empty upgrade handler + - Increased E2E_UPGRADE_VERSION in Makefile by 1 + labels: | + auto + e2e + app-wiring From 09c001b6c09ad02097d5260824cbc8530b899bae Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:09:16 +0700 Subject: [PATCH 030/106] save --- .github/workflows/auto-update-upgrade.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 9a9ff9807f0..201192220b7 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -16,17 +16,17 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 - with: + # with: # token: ${{ secrets.GITHUB_TOKEN }} # base: ${{ github.repository }} # commit-message: Auto post release updgrade # delete-branch: true # branch: main - body: | - Update report - - Created a new empty upgrade handler - - Increased E2E_UPGRADE_VERSION in Makefile by 1 - labels: | - auto - e2e - app-wiring + # body: | + # Update report + # - Created a new empty upgrade handler + # - Increased E2E_UPGRADE_VERSION in Makefile by 1 + # labels: | + # auto + # e2e + # app-wiring From b2e8857fc14bb8cee111e8a801d45434ea6e0567 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:10:21 +0700 Subject: [PATCH 031/106] save --- .github/workflows/auto-update-upgrade.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 201192220b7..9a9ff9807f0 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -16,17 +16,17 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 - # with: + with: # token: ${{ secrets.GITHUB_TOKEN }} # base: ${{ github.repository }} # commit-message: Auto post release updgrade # delete-branch: true # branch: main - # body: | - # Update report - # - Created a new empty upgrade handler - # - Increased E2E_UPGRADE_VERSION in Makefile by 1 - # labels: | - # auto - # e2e - # app-wiring + body: | + Update report + - Created a new empty upgrade handler + - Increased E2E_UPGRADE_VERSION in Makefile by 1 + labels: | + auto + e2e + app-wiring From 406b0a4ac590f8cd1717fea9b3d417ab7f739bce Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:13:46 +0700 Subject: [PATCH 032/106] save --- scripts/empty_upgrade_handler_gen.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 260bffc72c6..6669d660e65 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -25,21 +25,16 @@ cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go -SEDOPTION= -if [[ "$OSTYPE" == "darwin"* ]]; then - SEDOPTION="-i ''" -fi - - sed $SEDOPTION "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed $SEDOPTION "s/v$latest_version/v$version_create/g" $new_file/upgrades.go + sed -i '' "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed -i '' "s/v$latest_version/v$version_create/g" $new_file/upgrades.go bracks='"' # change imports in case go mod changed - sed $SEDOPTION "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed $SEDOPTION "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed $SEDOPTION "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed $SEDOPTION "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -i '' "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -i '' "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change e2e version in makefile - sed $SEDOPTION "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 4f37b2cc6993aace490d4bcec6f13f9a0413f000 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:31:01 +0700 Subject: [PATCH 033/106] save --- Makefile'' | 422 --------------------------- scripts/empty_upgrade_handler_gen.sh | 19 +- 2 files changed, 11 insertions(+), 430 deletions(-) delete mode 100644 Makefile'' diff --git a/Makefile'' b/Makefile'' deleted file mode 100644 index 5d4a5261e1d..00000000000 --- a/Makefile'' +++ /dev/null @@ -1,422 +0,0 @@ -#!/usr/bin/make -f - -VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') -COMMIT := $(shell git log -1 --format='%H') -LEDGER_ENABLED ?= true -SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') -GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) -DOCKER := $(shell which docker) -BUILDDIR ?= $(CURDIR)/build -E2E_UPGRADE_VERSION := "v13" - - -export GO111MODULE = on - -# process build tags - -build_tags = netgo -ifeq ($(LEDGER_ENABLED),true) - ifeq ($(OS),Windows_NT) - GCCEXE = $(shell where gcc.exe 2> NUL) - ifeq ($(GCCEXE),) - $(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) - else - build_tags += ledger - endif - else - UNAME_S = $(shell uname -s) - ifeq ($(UNAME_S),OpenBSD) - $(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) - else - GCC = $(shell command -v gcc 2> /dev/null) - ifeq ($(GCC),) - $(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) - else - build_tags += ledger - endif - endif - endif -endif - -ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) - build_tags += gcc -else ifeq (rocksdb,$(findstring rocksdb,$(OSMOSIS_BUILD_OPTIONS))) - build_tags += gcc -endif -build_tags += $(BUILD_TAGS) -build_tags := $(strip $(build_tags)) - -whitespace := -whitespace += $(whitespace) -comma := , -build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) - -# process linker flags - -ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=osmosis \ - -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd \ - -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ - -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" - -ifeq (cleveldb,$(findstring cleveldb,$(OSMOSIS_BUILD_OPTIONS))) - ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb -else ifeq (rocksdb,$(findstring rocksdb,$(OSMOSIS_BUILD_OPTIONS))) - ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=rocksdb -endif -ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) - ldflags += -w -s -endif -ifeq ($(LINK_STATICALLY),true) - ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" -endif -ldflags += $(LDFLAGS) -ldflags := $(strip $(ldflags)) - -BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' -# check for nostrip option -ifeq (,$(findstring nostrip,$(OSMOSIS_BUILD_OPTIONS))) - BUILD_FLAGS += -trimpath -endif - -############################################################################### -### Build ### -############################################################################### - -all: install lint test - -BUILD_TARGETS := build install - -build: BUILD_ARGS=-o $(BUILDDIR)/ - -$(BUILD_TARGETS): go.sum $(BUILDDIR)/ - go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... - -$(BUILDDIR)/: - mkdir -p $(BUILDDIR)/ - -# Cross-building for arm64 from amd64 (or viceversa) takes -# a lot of time due to QEMU virtualization but it's the only way (afaik) -# to get a statically linked binary with CosmWasm - -build-reproducible: build-reproducible-amd64 build-reproducible-arm64 - -build-reproducible-amd64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --platform linux/amd64 \ - -t osmosis-amd64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-amd64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-amd64 - $(DOCKER) rm -f osmobinary - -build-reproducible-arm64: go.sum $(BUILDDIR)/ - $(DOCKER) buildx create --name osmobuilder || true - $(DOCKER) buildx use osmobuilder - $(DOCKER) buildx build \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --platform linux/arm64 \ - -t osmosis-arm64 \ - --load \ - -f Dockerfile . - $(DOCKER) rm -f osmobinary || true - $(DOCKER) create -ti --name osmobinary osmosis-arm64 - $(DOCKER) cp osmobinary:/bin/osmosisd $(BUILDDIR)/osmosisd-linux-arm64 - $(DOCKER) rm -f osmobinary - -build-linux: go.sum - LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build - -build-contract-tests-hooks: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests - -go-mod-cache: go.sum - @echo "--> Download go modules to local cache" - @go mod download - -go.sum: go.mod - @echo "--> Ensure dependencies have not been modified" - @go mod verify - -draw-deps: - @# requires brew install graphviz or apt-get install graphviz - go get github.com/RobotsAndPencils/goviz - @goviz -i ./cmd/osmosisd -d 2 | dot -Tpng -o dependency-graph.png - -clean: - rm -rf $(CURDIR)/artifacts/ - -distclean: clean - rm -rf vendor/ - -############################################################################### -### Proto ### -############################################################################### - -proto-all: proto-format proto-gen - -proto: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/protocgen.sh - @echo - @echo "=========== Generate Complete ============" - @echo - -test: - @go test -v ./x/... - -docs: - @echo - @echo "=========== Generate Message ============" - @echo - ./scripts/generate-docs.sh - - statik -src=client/docs/static -dest=client/docs -f -m - @if [ -n "$(git status --porcelain)" ]; then \ - echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ - exit 1;\ - else \ - echo "\033[92mSwagger docs are in sync\033[0m";\ - fi - @echo - @echo "=========== Generate Complete ============" - @echo -.PHONY: docs - -protoVer=v0.8 -protoImageName=osmolabs/osmo-proto-gen:$(protoVer) -containerProtoGen=cosmos-sdk-proto-gen-$(protoVer) -containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer) - -proto-gen: - @echo "Generating Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ - sh ./scripts/protocgen.sh; fi - -proto-format: - @echo "Formatting Protobuf files" - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ - find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi - -proto-image-build: - @DOCKER_BUILDKIT=1 docker build -t $(protoImageName) -f ./proto/Dockerfile ./proto - -proto-image-push: - docker push $(protoImageName) - -############################################################################### -### Querygen ### -############################################################################### - -run-querygen: - @go run cmd/querygen/main.go - -############################################################################### -### Tests & Simulation ### -############################################################################### - -PACKAGES_UNIT=$(shell go list ./... | grep -E -v 'tests/simulator|e2e') -PACKAGES_E2E=$(shell go list -tags e2e ./... | grep '/e2e') -PACKAGES_SIM=$(shell go list ./... | grep '/tests/simulator') -TEST_PACKAGES=./... - -test: test-unit test-build - -test-all: check test-race test-cover - -test-unit: - @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock norace' $(PACKAGES_UNIT) - -test-race: - @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' $(PACKAGES_UNIT) - -test-cover: - @VERSION=$(VERSION) go test -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic $(PACKAGES_UNIT) - -test-sim-suite: - @VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_SIM) - -test-sim-app: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestFullAppSimulation -v $(PACKAGES_SIM) - -test-sim-determinism: - @VERSION=$(VERSION) go test -mod=readonly -run ^TestAppStateDeterminism -v $(PACKAGES_SIM) - -test-sim-bench: - @VERSION=$(VERSION) go test -benchmem -run ^BenchmarkFullAppSimulation -bench ^BenchmarkFullAppSimulation -cpuprofile cpu.out $(PACKAGES_SIM) - -# test-e2e runs a full e2e test suite -# deletes any pre-existing Osmosis containers before running. -# -# Attempts to delete Docker resources at the end. -# May fail to do so if stopped mid way. -# In that case, run `make e2e-remove-resources` -# manually. -# Utilizes Go cache. -test-e2e: e2e-setup test-e2e-ci - -# test-e2e-ci runs a full e2e test suite -# does not do any validation about the state of the Docker environment -# As a result, avoid using this locally. -test-e2e-ci: - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) - -# test-e2e-debug runs a full e2e test suite but does -# not attempt to delete Docker resources at the end. -test-e2e-debug: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_UPGRADE_VERSION=$(E2E_UPGRADE_VERSION) OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 - -# test-e2e-short runs the e2e test with only short tests. -# Does not delete any of the containers after running. -# Deletes any existing containers before running. -# Does not use Go cache. -test-e2e-short: e2e-setup - @VERSION=$(VERSION) OSMOSIS_E2E_DEBUG_LOG=True OSMOSIS_E2E_SKIP_UPGRADE=True OSMOSIS_E2E_SKIP_IBC=True OSMOSIS_E2E_SKIP_STATE_SYNC=True OSMOSIS_E2E_SKIP_CLEANUP=True go test -tags e2e -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 - -test-mutation: - @bash scripts/mutation-test.sh $(MODULES) - -benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_UNIT) - -build-e2e-script: - mkdir -p $(BUILDDIR) - go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME) - -docker-build-debug: - @DOCKER_BUILDKIT=1 docker build -t osmosis:${COMMIT} --build-arg BASE_IMG_TAG=debug -f Dockerfile . - @DOCKER_BUILDKIT=1 docker tag osmosis:${COMMIT} osmosis:debug - -docker-build-e2e-init-chain: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile . - -docker-build-e2e-init-node: - @DOCKER_BUILDKIT=1 docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile . - -e2e-setup: e2e-check-image-sha e2e-remove-resources - @echo Finished e2e environment setup, ready to start the test - -e2e-check-image-sha: - tests/e2e/scripts/run/check_image_sha.sh - -e2e-remove-resources: - tests/e2e/scripts/run/remove_stale_resources.sh - -.PHONY: test-mutation - -############################################################################### -### Docker ### -############################################################################### - -RUNNER_BASE_IMAGE_DISTROLESS := gcr.io/distroless/static -RUNNER_BASE_IMAGE_ALPINE := alpine:3.16 -RUNNER_BASE_IMAGE_NONROOT := gcr.io/distroless/static:nonroot - -docker-build: - @DOCKER_BUILDKIT=1 docker build \ - -t osmosis:local \ - -t osmosis:local-distroless \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - -docker-build-distroless: docker-build - -docker-build-alpine: - @DOCKER_BUILDKIT=1 docker build \ - -t osmosis:local-alpine \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - -docker-build-nonroot: - @DOCKER_BUILDKIT=1 docker build \ - -t osmosis:local-nonroot \ - --build-arg GO_VERSION=$(GO_VERSION) \ - --build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_NONROOT) \ - --build-arg GIT_VERSION=$(VERSION) \ - --build-arg GIT_COMMIT=$(COMMIT) \ - -f Dockerfile . - -############################################################################### -### Linting ### -############################################################################### - -lint: - @echo "--> Running linter" - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" - -format: - @go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix - @go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/ - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix - -mdlint: - @echo "--> Running markdown linter" - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" - -markdown: - @docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix - -############################################################################### -### Localnet ### -############################################################################### - -localnet-keys: - . tests/localosmosis/scripts/add_keys.sh - -localnet-init: localnet-clean localnet-build - -localnet-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/docker-compose.yml build - -localnet-start: - @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml up - -localnet-start-with-state: - @STATE=-s docker-compose -f tests/localosmosis/docker-compose.yml up - -localnet-startd: - @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml up -d - -localnet-startd-with-state: - @STATE=-s docker-compose -f tests/localosmosis/docker-compose.yml up -d - -localnet-stop: - @STATE="" docker-compose -f tests/localosmosis/docker-compose.yml down - -localnet-clean: - @rm -rfI $(HOME)/.osmosisd/ - -localnet-state-export-init: localnet-state-export-clean localnet-state-export-build - -localnet-state-export-build: - @DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f tests/localosmosis/state_export/docker-compose.yml build - -localnet-state-export-start: - @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up - -localnet-state-export-startd: - @docker-compose -f tests/localosmosis/state_export/docker-compose.yml up -d - -localnet-state-export-stop: - @docker-compose -f tests/localosmosis/docker-compose.yml down - -localnet-state-export-clean: localnet-clean - -.PHONY: all build-linux install format lint \ - go-mod-cache draw-deps clean build build-contract-tests-hooks \ - test test-all test-build test-cover test-unit test-race benchmark diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 6669d660e65..0afa8f99f48 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -24,17 +24,20 @@ cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go - - sed -i '' "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed -i '' "s/v$latest_version/v$version_create/g" $new_file/upgrades.go +# SEDBRACKETS= +# if [[ "$OSTYPE" == "darwin"* ]]; then +# SEDBRACKETS='' +# fi + sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go bracks='"' # change imports in case go mod changed - sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -i '' "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -i '' "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -i '' "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed -iS "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -iS "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -iS "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change e2e version in makefile - sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -iS "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 36d3229dde245b0ed9a234f108f1c70ce3230494 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:33:02 +0700 Subject: [PATCH 034/106] save --- scripts/empty_upgrade_handler_gen.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 0afa8f99f48..304a88e55ed 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -35,9 +35,9 @@ # change imports in case go mod changed sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -iS "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -iS "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -iS "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change e2e version in makefile - sed -iS "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 453e8f4d82e3330f20a4950bde9f3ab53d4238c4 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:36:20 +0700 Subject: [PATCH 035/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 12 +++--------- scripts/empty_upgrade_handler_gen.sh | 5 +---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 9a9ff9807f0..a6b95eb32ac 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -1,9 +1,8 @@ name: On Release Auto Upgrade -# on: -# release: -# types: [deleted] -on: [push] +on: + release: + types: [created] jobs: build: runs-on: ubuntu-latest @@ -17,11 +16,6 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - # token: ${{ secrets.GITHUB_TOKEN }} - # base: ${{ github.repository }} - # commit-message: Auto post release updgrade - # delete-branch: true - # branch: main body: | Update report - Created a new empty upgrade handler diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 304a88e55ed..73ba9b43bad 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -24,10 +24,7 @@ cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go -# SEDBRACKETS= -# if [[ "$OSTYPE" == "darwin"* ]]; then -# SEDBRACKETS='' -# fi + sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go From 525be313990cbe56df42e2a1ff64218f2d2ab0ab Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:39:08 +0700 Subject: [PATCH 036/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index a6b95eb32ac..a4af03d7708 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -16,6 +16,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: + base: ${{ github.head_ref }} body: | Update report - Created a new empty upgrade handler From 5b29f1d0d1a3fc7c69eaa52a79fcdfd1a75915c6 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:40:56 +0700 Subject: [PATCH 037/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index a4af03d7708..b05366608c9 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,6 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout + run: echo ${{ github.head_ref }} uses: actions/checkout@v2.3.4 - name: Running script From 553acbc53ca7470fec107496222b87eaa7fb907a Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:42:07 +0700 Subject: [PATCH 038/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b05366608c9..17239fc563d 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,8 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - run: echo ${{ github.head_ref }} uses: actions/checkout@v2.3.4 + - name: CHECKS + run: echo ${{ github.head_ref }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh From f600966445b72bbf8350be76a58128b7b5084f02 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:45:24 +0700 Subject: [PATCH 039/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 17239fc563d..eeb3c23e4fe 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo ${{ github.head_ref }} + run: echo ${{ github.ref }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -18,7 +18,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ github.head_ref }} + base: ${{ github.ref }} body: | Update report - Created a new empty upgrade handler From 6d5405ab5c901e977bd51f0087a97bd1574b32a0 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:51:42 +0700 Subject: [PATCH 040/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index eeb3c23e4fe..b720255315f 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo ${{ github.ref }} + run: echo ${{ github.event.workflow_run.head_sha }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -18,7 +18,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ github.ref }} + base: ${{ github.event.workflow_run.head_sha }} body: | Update report - Created a new empty upgrade handler From fc62b8c39a2dfacc326651ea910e7897f354b8a0 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 16:53:30 +0700 Subject: [PATCH 041/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b720255315f..7c18ee0e470 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo ${{ github.event.workflow_run.head_sha }} + run: echo ${{ github.repository }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -18,7 +18,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ github.event.workflow_run.head_sha }} + base: ${{ github.repository }} body: | Update report - Created a new empty upgrade handler From 57221777cad21f00d93e0abb2d76489987e677cd Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 17:01:01 +0700 Subject: [PATCH 042/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 7c18ee0e470..0106944f901 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo ${{ github.repository }} + run: echo ${{ env.GITHUB_WORKSPACE }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -18,7 +18,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ github.repository }} + base: ${{ env.GITHUB_WORKSPACE }} body: | Update report - Created a new empty upgrade handler From 42ab2bb7035415f65c2c3373551177fce383a38c Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 17:05:13 +0700 Subject: [PATCH 043/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 0106944f901..6e40af0102f 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 + with: + ref: ${{ inputs.target-branch }} - name: CHECKS run: echo ${{ env.GITHUB_WORKSPACE }} @@ -18,12 +20,12 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ env.GITHUB_WORKSPACE }} + base: ${{ inputs.target-branch }} body: | Update report - Created a new empty upgrade handler - Increased E2E_UPGRADE_VERSION in Makefile by 1 labels: | - auto - e2e - app-wiring + T:auto + C:e2e + C:app-wiring From 1a7f5d933d727a3e4906f029fc4253bf451ffa22 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 17:10:01 +0700 Subject: [PATCH 044/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 6e40af0102f..125585e2472 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,8 +9,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 - with: - ref: ${{ inputs.target-branch }} + # with: + # ref: ${{ inputs.target-branch }} - name: CHECKS run: echo ${{ env.GITHUB_WORKSPACE }} @@ -20,7 +20,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: ${{ inputs.target-branch }} + base: main body: | Update report - Created a new empty upgrade handler From 60b653be48102d9550c78bafb6cff19b1071cae7 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 17:12:13 +0700 Subject: [PATCH 045/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 125585e2472..015af422db0 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ jobs: # with: # ref: ${{ inputs.target-branch }} - name: CHECKS - run: echo ${{ env.GITHUB_WORKSPACE }} + run: echo ${{ github.event.repository.default_branch }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh @@ -20,7 +20,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: - base: main + base: ${{ github.event.repository.default_branch }} body: | Update report - Created a new empty upgrade handler From 77cf4705519efef5d3f4e2be3ce9f7c48ef1763f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Wed, 19 Oct 2022 17:13:39 +0700 Subject: [PATCH 046/106] On release auto upgrade --- .github/workflows/auto-update-upgrade.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 015af422db0..4a261d48229 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,10 +9,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 - # with: - # ref: ${{ inputs.target-branch }} - - name: CHECKS - run: echo ${{ github.event.repository.default_branch }} - name: Running script run: bash ./scripts/empty_upgrade_handler_gen.sh From 4e5dc758d9f06e6eaf06089a10d805f89c3d1029 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Thu, 20 Oct 2022 23:37:01 +0700 Subject: [PATCH 047/106] docs --- .github/workflows/auto-update-upgrade.yml | 5 +++++ scripts/empty_upgrade_handler_gen.sh | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 4a261d48229..1ebc8f422cd 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -1,3 +1,8 @@ +# When new release is created this workflow will be triggered and will do 3 things: +# 1) it will create a directory with an empty upgrade handler in app/upgrades folder +# 2) will increase an E2E_UPGRADE_VERSION variable in Makefile +# 3) create a pull request with these changes to main + name: On Release Auto Upgrade on: diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 73ba9b43bad..e80404754ae 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -1,5 +1,14 @@ #!/bin/bash +# this script creates an empty directory in app/upgrades called "vX" where X is a previous version + 1 and +# copies upgrade handler from the previous release with increased version where needed. Also insures that all the imports +# make use of a current module version from go mod (see: + +# module=$(go mod edit -json | jq ".Module.Path") in this script + +# ) +# Github workflow which calls this script can be found here: osmosis/.github/workflows/auto-update-upgrade.yml + latest_version=0 for f in app/upgrades/*; do s_f=(${f//// }) From e48f0110e730680ced4e5ef40a2d20cc73dac275 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 21 Oct 2022 12:47:52 +0700 Subject: [PATCH 048/106] save --- scripts/empty_upgrade_handler_gen.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index e80404754ae..9d4e10123c3 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -45,5 +45,7 @@ sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go +app_file=./app/app.go +sed -i "s|.*Upgrades = []upgrades.Upgrade{.*|hello|" $app_file # change e2e version in makefile sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 0eb3cc8e33829873e6cd8e2e1bff820898b6dd56 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 21 Oct 2022 13:46:30 +0700 Subject: [PATCH 049/106] also changes app.go --- scripts/empty_upgrade_handler_gen.sh | 46 ++++++++++++++++------------ 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 9d4e10123c3..c6794a2ffc2 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -15,37 +15,45 @@ version=${s_f[2]} num_version=${version//[!0-9]/} if [[ $num_version -gt $latest_version ]]; then - latest_version=$num_version + LATEST_FILE=$f + latest_version=$num_version fi done + VERSION_CREATE=$((latest_version+1)) + NEW_FILE=./app/upgrades/v${VERSION_CREATE} - version_create=$((latest_version+1)) - new_file=./app/upgrades/v${version_create} + mkdir $NEW_FILE - mkdir $new_file - - touch $new_file/constants.go - touch $new_file/upgrades.go + touch $NEW_FILE/constants.go + touch $NEW_FILE/upgrades.go module=$(go mod edit -json | jq ".Module.Path") module=${module%?} path=${module%???} - cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go - cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go + cp ./app/upgrades/v${latest_version}/constants.go $NEW_FILE/constants.go + cp ./app/upgrades/v${latest_version}/upgrades.go $NEW_FILE/upgrades.go - sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go + sed -i "s/v$latest_version/v$VERSION_CREATE/g" $NEW_FILE/constants.go + sed -i "s/v$latest_version/v$VERSION_CREATE/g" $NEW_FILE/upgrades.go bracks='"' # change imports in case go mod changed - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go - -app_file=./app/app.go -sed -i "s|.*Upgrades = []upgrades.Upgrade{.*|hello|" $app_file + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $NEW_FILE/constants.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $NEW_FILE/upgrades.go + sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $NEW_FILE/upgrades.go + sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $NEW_FILE/upgrades.go + + # change app/app.go file + app_file=./app/app.go + UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) + UPGRADES_LINE="${UPGRADES_LINE%?}, v${VERSION_CREATE}.Upgrade}" + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + + PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" + NEW_IMPORT="v$VERSION_CREATE $module/app/upgrades/v$VERSION_CREATE$bracks" + sed -i"s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + # change e2e version in makefile - sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$VERSION_CREATE$bracks/" ./Makefile \ No newline at end of file From b6218b5001352dd9220b239e15a23dc4a4c5d8a4 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 21 Oct 2022 13:48:04 +0700 Subject: [PATCH 050/106] also changes app.go --- scripts/empty_upgrade_handler_gen.sh | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index c6794a2ffc2..8e1a29fd029 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -2,24 +2,24 @@ # this script creates an empty directory in app/upgrades called "vX" where X is a previous version + 1 and # copies upgrade handler from the previous release with increased version where needed. Also insures that all the imports -# make use of a current module version from go mod (see: +# make use of a current MODULE version from go mod (see: -# module=$(go mod edit -json | jq ".Module.Path") in this script +# MODULE=$(go mod edit -json | jq ".MODULE.Path") in this script # ) # Github workflow which calls this script can be found here: osmosis/.github/workflows/auto-update-upgrade.yml - latest_version=0 + LATEST_VERSION=0 for f in app/upgrades/*; do s_f=(${f//// }) version=${s_f[2]} num_version=${version//[!0-9]/} - if [[ $num_version -gt $latest_version ]]; then + if [[ $num_version -gt $LATEST_VERSION ]]; then LATEST_FILE=$f - latest_version=$num_version + LATEST_VERSION=$num_version fi done - VERSION_CREATE=$((latest_version+1)) + VERSION_CREATE=$((LATEST_VERSION+1)) NEW_FILE=./app/upgrades/v${VERSION_CREATE} mkdir $NEW_FILE @@ -27,33 +27,33 @@ touch $NEW_FILE/constants.go touch $NEW_FILE/upgrades.go - module=$(go mod edit -json | jq ".Module.Path") - module=${module%?} - path=${module%???} + MODULE=$(go mod edit -json | jq ".MODULE.Path") + MODULE=${MODULE%?} + path=${MODULE%???} - cp ./app/upgrades/v${latest_version}/constants.go $NEW_FILE/constants.go - cp ./app/upgrades/v${latest_version}/upgrades.go $NEW_FILE/upgrades.go + cp ./app/upgrades/v${LATEST_VERSION}/constants.go $NEW_FILE/constants.go + cp ./app/upgrades/v${LATEST_VERSION}/upgrades.go $NEW_FILE/upgrades.go - sed -i "s/v$latest_version/v$VERSION_CREATE/g" $NEW_FILE/constants.go - sed -i "s/v$latest_version/v$VERSION_CREATE/g" $NEW_FILE/upgrades.go + sed -i "s/v$LATEST_VERSION/v$VERSION_CREATE/g" $NEW_FILE/constants.go + sed -i "s/v$LATEST_VERSION/v$VERSION_CREATE/g" $NEW_FILE/upgrades.go - bracks='"' + BRACKS='"' # change imports in case go mod changed - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $NEW_FILE/constants.go - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $NEW_FILE/upgrades.go - sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $NEW_FILE/upgrades.go - sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $NEW_FILE/upgrades.go + sed -i "s|.*/app/upgrades.*|\t$MODULE/app/upgrades$BRACKS|" $NEW_FILE/constants.go + sed -i "s|.*/app/upgrades.*|\t$MODULE/app/upgrades$BRACKS|" $NEW_FILE/upgrades.go + sed -i "s|.*/app/keepers.*|\t$MODULE/app/keepers$BRACKS|" $NEW_FILE/upgrades.go + sed -i "s|.*/x/lockup/types.*|\tlockuptypes $MODULE/x/lockup/types$BRACKS|" $NEW_FILE/upgrades.go # change app/app.go file - app_file=./app/app.go - UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) + APP_FILE=./app/app.go + UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $APP_FILE) UPGRADES_LINE="${UPGRADES_LINE%?}, v${VERSION_CREATE}.Upgrade}" - sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $APP_FILE - PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" - NEW_IMPORT="v$VERSION_CREATE $module/app/upgrades/v$VERSION_CREATE$bracks" - sed -i"s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + PREV_IMPORT="v$LATEST_VERSION $MODULE/app/upgrades/v$LATEST_VERSION$BRACKS" + NEW_IMPORT="v$VERSION_CREATE $MODULE/app/upgrades/v$VERSION_CREATE$BRACKS" + sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $APP_FILE # change e2e version in makefile - sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$VERSION_CREATE$bracks/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${BRACKS}v$LATEST_VERSION$BRACKS/E2E_UPGRADE_VERSION := ${BRACKS}v$VERSION_CREATE$BRACKS/" ./Makefile \ No newline at end of file From 447a35c05e7abaaf466bcbd46278ac488e6fd565 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 21 Oct 2022 13:54:22 +0700 Subject: [PATCH 051/106] also changes app.go --- scripts/empty_upgrade_handler_gen.sh | 62 ++++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 8e1a29fd029..53395ef932b 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -2,58 +2,58 @@ # this script creates an empty directory in app/upgrades called "vX" where X is a previous version + 1 and # copies upgrade handler from the previous release with increased version where needed. Also insures that all the imports -# make use of a current MODULE version from go mod (see: +# make use of a current module version from go mod (see: -# MODULE=$(go mod edit -json | jq ".MODULE.Path") in this script +# module=$(go mod edit -json | jq ".Module.Path") in this script # ) # Github workflow which calls this script can be found here: osmosis/.github/workflows/auto-update-upgrade.yml - LATEST_VERSION=0 + latest_version=0 for f in app/upgrades/*; do s_f=(${f//// }) version=${s_f[2]} num_version=${version//[!0-9]/} - if [[ $num_version -gt $LATEST_VERSION ]]; then + if [[ $num_version -gt $latest_version ]]; then LATEST_FILE=$f - LATEST_VERSION=$num_version + latest_version=$num_version fi done - VERSION_CREATE=$((LATEST_VERSION+1)) - NEW_FILE=./app/upgrades/v${VERSION_CREATE} + version_create=$((latest_version+1)) + new_file=./app/upgrades/v${version_create} - mkdir $NEW_FILE + mkdir $new_file - touch $NEW_FILE/constants.go - touch $NEW_FILE/upgrades.go + touch $new_file/constants.go + touch $new_file/upgrades.go - MODULE=$(go mod edit -json | jq ".MODULE.Path") - MODULE=${MODULE%?} - path=${MODULE%???} + module=$(go mod edit -json | jq ".Module.Path") + module=${module%?} + path=${module%???} - cp ./app/upgrades/v${LATEST_VERSION}/constants.go $NEW_FILE/constants.go - cp ./app/upgrades/v${LATEST_VERSION}/upgrades.go $NEW_FILE/upgrades.go + cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go + cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go - sed -i "s/v$LATEST_VERSION/v$VERSION_CREATE/g" $NEW_FILE/constants.go - sed -i "s/v$LATEST_VERSION/v$VERSION_CREATE/g" $NEW_FILE/upgrades.go + sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go - BRACKS='"' + bracks='"' # change imports in case go mod changed - sed -i "s|.*/app/upgrades.*|\t$MODULE/app/upgrades$BRACKS|" $NEW_FILE/constants.go - sed -i "s|.*/app/upgrades.*|\t$MODULE/app/upgrades$BRACKS|" $NEW_FILE/upgrades.go - sed -i "s|.*/app/keepers.*|\t$MODULE/app/keepers$BRACKS|" $NEW_FILE/upgrades.go - sed -i "s|.*/x/lockup/types.*|\tlockuptypes $MODULE/x/lockup/types$BRACKS|" $NEW_FILE/upgrades.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change app/app.go file - APP_FILE=./app/app.go - UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $APP_FILE) - UPGRADES_LINE="${UPGRADES_LINE%?}, v${VERSION_CREATE}.Upgrade}" - sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $APP_FILE - - PREV_IMPORT="v$LATEST_VERSION $MODULE/app/upgrades/v$LATEST_VERSION$BRACKS" - NEW_IMPORT="v$VERSION_CREATE $MODULE/app/upgrades/v$VERSION_CREATE$BRACKS" - sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $APP_FILE + app_file=./app/app.go + UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) + UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + + PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" + NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" + sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file # change e2e version in makefile - sed -i "s/E2E_UPGRADE_VERSION := ${BRACKS}v$LATEST_VERSION$BRACKS/E2E_UPGRADE_VERSION := ${BRACKS}v$VERSION_CREATE$BRACKS/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 5545bfd492fee79d26d57d448f8abe00b16226d8 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Sat, 22 Oct 2022 15:52:21 +0700 Subject: [PATCH 052/106] test using ci because will run forever on m1 with qemu --- app/upgrades/v14/constants.go | 16 ++++++++++++++++ app/upgrades/v14/upgrades.go | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 app/upgrades/v14/constants.go create mode 100644 app/upgrades/v14/upgrades.go diff --git a/app/upgrades/v14/constants.go b/app/upgrades/v14/constants.go new file mode 100644 index 00000000000..7779df096f6 --- /dev/null +++ b/app/upgrades/v14/constants.go @@ -0,0 +1,16 @@ +package v13 + +import ( + "github.com/osmosis-labs/osmosis/v12/app/upgrades" + + store "github.com/cosmos/cosmos-sdk/store/types" +) + +// UpgradeName defines the on-chain upgrade name for the Osmosis v9 upgrade. +const UpgradeName = "v13" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/v14/upgrades.go b/app/upgrades/v14/upgrades.go new file mode 100644 index 00000000000..a58bf8aabb4 --- /dev/null +++ b/app/upgrades/v14/upgrades.go @@ -0,0 +1,23 @@ +package v13 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/osmosis-labs/osmosis/v12/app/keepers" + "github.com/osmosis-labs/osmosis/v12/app/upgrades" + lockuptypes "github.com/osmosis-labs/osmosis/v12/x/lockup/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + bpm upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + keepers.LockupKeeper.SetParams(ctx, lockuptypes.DefaultParams()) + return mm.RunMigrations(ctx, configurator, fromVM) + } +} From 752b03792ac7183b71395ba8ddf43c27cb92ed48 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Sat, 22 Oct 2022 16:10:03 +0700 Subject: [PATCH 053/106] save --- app/upgrades/v14/constants.go | 16 ---------------- app/upgrades/v14/upgrades.go | 23 ----------------------- scripts/empty_upgrade_handler_gen.sh | 18 +++++++++--------- 3 files changed, 9 insertions(+), 48 deletions(-) delete mode 100644 app/upgrades/v14/constants.go delete mode 100644 app/upgrades/v14/upgrades.go diff --git a/app/upgrades/v14/constants.go b/app/upgrades/v14/constants.go deleted file mode 100644 index 7779df096f6..00000000000 --- a/app/upgrades/v14/constants.go +++ /dev/null @@ -1,16 +0,0 @@ -package v13 - -import ( - "github.com/osmosis-labs/osmosis/v12/app/upgrades" - - store "github.com/cosmos/cosmos-sdk/store/types" -) - -// UpgradeName defines the on-chain upgrade name for the Osmosis v9 upgrade. -const UpgradeName = "v13" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} diff --git a/app/upgrades/v14/upgrades.go b/app/upgrades/v14/upgrades.go deleted file mode 100644 index a58bf8aabb4..00000000000 --- a/app/upgrades/v14/upgrades.go +++ /dev/null @@ -1,23 +0,0 @@ -package v13 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/osmosis-labs/osmosis/v12/app/keepers" - "github.com/osmosis-labs/osmosis/v12/app/upgrades" - lockuptypes "github.com/osmosis-labs/osmosis/v12/x/lockup/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - bpm upgrades.BaseAppParamManager, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - keepers.LockupKeeper.SetParams(ctx, lockuptypes.DefaultParams()) - return mm.RunMigrations(ctx, configurator, fromVM) - } -} diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 53395ef932b..46069845168 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -34,26 +34,26 @@ cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go - sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go + sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go + sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go bracks='"' # change imports in case go mod changed - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go + sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go + sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go + sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go # change app/app.go file app_file=./app/app.go UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" - sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" - sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + sed -i"s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file # change e2e version in makefile - sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From ffce6d77f0b1323f2ccf30a7e9f66ee3d79b5faa Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Sat, 22 Oct 2022 16:22:44 +0700 Subject: [PATCH 054/106] post release action --- scripts/empty_upgrade_handler_gen.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 46069845168..be9e15a1498 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -44,16 +44,6 @@ sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go - - # change app/app.go file - app_file=./app/app.go - UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) - UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" - sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file - - PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" - NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" - sed -i"s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file # change e2e version in makefile sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 3d4444d5c69d5c0346ee209f94e6dd36af7d2e31 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Sat, 22 Oct 2022 16:37:08 +0700 Subject: [PATCH 055/106] post release github action --- scripts/empty_upgrade_handler_gen.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index be9e15a1498..2cfb8269303 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -45,5 +45,15 @@ sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + # change app/app.go file + app_file=./app/app.go + UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) + UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + + PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" + NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" + sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + # change e2e version in makefile sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 54f20bdd273c0b8ad258a24be04bfc5f1b66b001 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 17:49:09 +0700 Subject: [PATCH 056/106] auto postrelease action --- scripts/empty_upgrade_handler_gen.sh | 68 +++++++++++++++++++++------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 2cfb8269303..48af94913d4 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -23,37 +23,73 @@ new_file=./app/upgrades/v${version_create} mkdir $new_file - - touch $new_file/constants.go - touch $new_file/upgrades.go + CONSTANTS_FILE=$new_file/constants.go + UPGRADES_FILE=$new_file/upgrades.go + touch $CONSTANTS_FILE + touch $UPGRADES_FILE + module=$(go mod edit -json | jq ".Module.Path") module=${module%?} path=${module%???} - cp ./app/upgrades/v${latest_version}/constants.go $new_file/constants.go - cp ./app/upgrades/v${latest_version}/upgrades.go $new_file/upgrades.go + bracks='"' + # set packages + echo -e "package v${version_create}\n" >> $CONSTANTS_FILE + echo -e "package v${version_create}\n" >> $UPGRADES_FILE - sed -i "s/v$latest_version/v$version_create/g" $new_file/constants.go - sed -i "s/v$latest_version/v$version_create/g" $new_file/upgrades.go + # imports + echo "import (" >> $CONSTANTS_FILE + echo "import (" >> $UPGRADES_FILE - bracks='"' + # set imports for constants.go + echo -e "\t$module/app/upgrades$bracks\n" >> $CONSTANTS_FILE + echo -e '\tstore "github.com/cosmos/cosmos-sdk/store/types"' >> $CONSTANTS_FILE - # change imports in case go mod changed - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/constants.go - sed -i "s|.*/app/upgrades.*|\t$module/app/upgrades$bracks|" $new_file/upgrades.go - sed -i "s|.*/app/keepers.*|\t$module/app/keepers$bracks|" $new_file/upgrades.go - sed -i "s|.*/x/lockup/types.*|\tlockuptypes $module/x/lockup/types$bracks|" $new_file/upgrades.go + # set imports for upgrades.go + echo -e '\tsdk "github.com/cosmos/cosmos-sdk/types"' >> $UPGRADES_FILE + echo -e '\t"github.com/cosmos/cosmos-sdk/types/module"' >> $UPGRADES_FILE + echo -e '\tupgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"\n' >> $UPGRADES_FILE + echo -e "\t$module/app/keepers$bracks" >> $UPGRADES_FILE + echo -e "\t$module/app/upgrades$bracks" >> $UPGRADES_FILE + echo -e "\tlockuptypes $module/x/lockup/types$bracks" >> UPGRADES_FILE + + # close import + echo ")" >> $UPGRADES_FILE + echo -e ")\n" >> $CONSTANTS_FILE + + # constants.go logic + echo "// UpgradeName defines the on-chain upgrade name for the Osmosis v$version_create upgrade." >> $CONSTANTS_FILE + echo "const UpgradeName = ${bracks}v$version_create$bracks" >> $CONSTANTS_FILE + echo " +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +}" >> $CONSTANTS_FILE + # upgrades.go logic + echo " +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + bpm upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, fromVM) + } +}" >> $UPGRADES_FILE + # change app/app.go file app_file=./app/app.go UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" - sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + sed -i '' "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" - sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + sed -i '' "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file # change e2e version in makefile - sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 59b6fe3ea003ff5bf344fa78edd4cdc965999c49 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 17:56:28 +0700 Subject: [PATCH 057/106] cleanup --- scripts/empty_upgrade_handler_gen.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 48af94913d4..dff1d5149f8 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -85,11 +85,11 @@ func CreateUpgradeHandler( app_file=./app/app.go UPGRADES_LINE=$(grep -F upgrades.Upgrade{ $app_file) UPGRADES_LINE="${UPGRADES_LINE%?}, v${version_create}.Upgrade}" - sed -i '' "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file + sed -i "s|.*upgrades.Upgrade{.*|$UPGRADES_LINE|" $app_file PREV_IMPORT="v$latest_version $module/app/upgrades/v$latest_version$bracks" NEW_IMPORT="v$version_create $module/app/upgrades/v$version_create$bracks" - sed -i '' "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file + sed -i "s|.*$PREV_IMPORT.*|\t$PREV_IMPORT\n\t$NEW_IMPORT|" $app_file # change e2e version in makefile - sed -i '' "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file + sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VERSION := ${bracks}v$version_create$bracks/" ./Makefile \ No newline at end of file From 9bd65f5ff81436368ae9d84b1fe15d1d89f2f584 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 17:59:44 +0700 Subject: [PATCH 058/106] cleanup --- scripts/empty_upgrade_handler_gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index dff1d5149f8..aae642cc918 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -52,7 +52,7 @@ echo -e '\tupgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"\n' >> $UPGRADES_FILE echo -e "\t$module/app/keepers$bracks" >> $UPGRADES_FILE echo -e "\t$module/app/upgrades$bracks" >> $UPGRADES_FILE - echo -e "\tlockuptypes $module/x/lockup/types$bracks" >> UPGRADES_FILE + echo -e "\tlockuptypes $module/x/lockup/types$bracks" >> $UPGRADES_FILE # close import echo ")" >> $UPGRADES_FILE From 1f6d4611f95d34c4c5011bf8617872e5347a1b56 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 18:00:50 +0700 Subject: [PATCH 059/106] cleanup --- app/upgrades/v14/constants.go | 16 ++++++++++++++++ app/upgrades/v14/upgrades.go | 22 ++++++++++++++++++++++ scripts/empty_upgrade_handler_gen.sh | 1 - 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 app/upgrades/v14/constants.go create mode 100644 app/upgrades/v14/upgrades.go diff --git a/app/upgrades/v14/constants.go b/app/upgrades/v14/constants.go new file mode 100644 index 00000000000..650715168aa --- /dev/null +++ b/app/upgrades/v14/constants.go @@ -0,0 +1,16 @@ +package v14 + +import ( + "github.com/osmosis-labs/osmosis/v12/app/upgrades" + + store "github.com/cosmos/cosmos-sdk/store/types" +) + +// UpgradeName defines the on-chain upgrade name for the Osmosis v14 upgrade. +const UpgradeName = "v14" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/v14/upgrades.go b/app/upgrades/v14/upgrades.go new file mode 100644 index 00000000000..47045e3cc72 --- /dev/null +++ b/app/upgrades/v14/upgrades.go @@ -0,0 +1,22 @@ +package v14 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/osmosis-labs/osmosis/v12/app/keepers" + "github.com/osmosis-labs/osmosis/v12/app/upgrades" + lockuptypes "github.com/osmosis-labs/osmosis/v12/x/lockup/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + bpm upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, fromVM) + } +} diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index aae642cc918..40388a8c8fc 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -52,7 +52,6 @@ echo -e '\tupgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"\n' >> $UPGRADES_FILE echo -e "\t$module/app/keepers$bracks" >> $UPGRADES_FILE echo -e "\t$module/app/upgrades$bracks" >> $UPGRADES_FILE - echo -e "\tlockuptypes $module/x/lockup/types$bracks" >> $UPGRADES_FILE # close import echo ")" >> $UPGRADES_FILE From d06b51156ae81913bd9a6e826f3221e70f48591b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 18:01:14 +0700 Subject: [PATCH 060/106] del --- app/upgrades/v14/constants.go | 16 ---------------- app/upgrades/v14/upgrades.go | 22 ---------------------- 2 files changed, 38 deletions(-) delete mode 100644 app/upgrades/v14/constants.go delete mode 100644 app/upgrades/v14/upgrades.go diff --git a/app/upgrades/v14/constants.go b/app/upgrades/v14/constants.go deleted file mode 100644 index 650715168aa..00000000000 --- a/app/upgrades/v14/constants.go +++ /dev/null @@ -1,16 +0,0 @@ -package v14 - -import ( - "github.com/osmosis-labs/osmosis/v12/app/upgrades" - - store "github.com/cosmos/cosmos-sdk/store/types" -) - -// UpgradeName defines the on-chain upgrade name for the Osmosis v14 upgrade. -const UpgradeName = "v14" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{}, -} diff --git a/app/upgrades/v14/upgrades.go b/app/upgrades/v14/upgrades.go deleted file mode 100644 index 47045e3cc72..00000000000 --- a/app/upgrades/v14/upgrades.go +++ /dev/null @@ -1,22 +0,0 @@ -package v14 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/osmosis-labs/osmosis/v12/app/keepers" - "github.com/osmosis-labs/osmosis/v12/app/upgrades" - lockuptypes "github.com/osmosis-labs/osmosis/v12/x/lockup/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - bpm upgrades.BaseAppParamManager, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, configurator, fromVM) - } -} From 8c54d59a405613dcaf17433fbf78a7006ea81fec Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Mon, 24 Oct 2022 18:04:09 +0700 Subject: [PATCH 061/106] docs --- scripts/empty_upgrade_handler_gen.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 40388a8c8fc..243bc2adb94 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -1,12 +1,11 @@ #!/bin/bash -# this script creates an empty directory in app/upgrades called "vX" where X is a previous version + 1 and -# copies upgrade handler from the previous release with increased version where needed. Also insures that all the imports -# make use of a current module version from go mod (see: +# 1) this script creates an empty directory in app/upgrades called "vX" where X is a previous version + 1 with an empty upgrade handler. +# 2) increases E2E_UPGRADE_VERSION in makefile by 1 +# 3) adds new version to app.go -# module=$(go mod edit -json | jq ".Module.Path") in this script - -# ) +# Also insures that all the imports make use of a current module version from go mod: +# (see: module=$(go mod edit -json | jq ".Module.Path") in this script) # Github workflow which calls this script can be found here: osmosis/.github/workflows/auto-update-upgrade.yml latest_version=0 From e7f3e412aa6fc9d4b1bdc2190dd05e1aa15edf45 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 10:39:51 +0700 Subject: [PATCH 062/106] major --- .github/workflows/auto-update-upgrade.yml | 16 +++++++++++++--- scripts/check_release.sh | 21 +++++++++++++++++++++ scripts/empty_upgrade_handler_gen.sh | 1 - 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 scripts/check_release.sh diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 1ebc8f422cd..e45663b6408 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,14 +9,24 @@ on: release: types: [created] jobs: - build: + check_release_version: + runs-on: ubuntu-latest + # this script will create a new temp.txt file and write 1 to it if a new version is major (major == in version vX.Y.Z changed X) + steps: + - name: Check is release is major + run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} + + post_release: + if: $(head -n 1 ./temp) == 1 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - + - name: Running script - run: bash ./scripts/empty_upgrade_handler_gen.sh + run: | + bash ./scripts/empty_upgrade_handler_gen.sh + rm -rf ./temp - name: Create Pull Request uses: peter-evans/create-pull-request@v4 diff --git a/scripts/check_release.sh b/scripts/check_release.sh new file mode 100644 index 00000000000..96b848043da --- /dev/null +++ b/scripts/check_release.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +VERSION=$1 +echo $VERSION ÆAAAAAAAAAAA +latest_version=0 +for f in app/upgrades/*; do + s_f=(${f//// }) + version=${s_f[2]} + num_version=${version//[!0-9]/} + if [[ $num_version -gt $latest_version ]]; then + latest_version=$num_version + fi +done + +VERSION=${VERSION[@]:1} +VERSION_MAJOR=(${VERSION//./ }) +VERSION_MAJOR=${VERSION_MAJOR[0]} +if [[ $VERSION_MAJOR -gt $latest_version ]]; then + touch ./temp.txt + echo 1 >> ./temp.txt +fi \ No newline at end of file diff --git a/scripts/empty_upgrade_handler_gen.sh b/scripts/empty_upgrade_handler_gen.sh index 243bc2adb94..1ca78fcbcab 100755 --- a/scripts/empty_upgrade_handler_gen.sh +++ b/scripts/empty_upgrade_handler_gen.sh @@ -27,7 +27,6 @@ touch $CONSTANTS_FILE touch $UPGRADES_FILE - module=$(go mod edit -json | jq ".Module.Path") module=${module%?} path=${module%???} From 5dcd952078f24bd95a4682ae59642ed452f6f29f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 10:49:49 +0700 Subject: [PATCH 063/106] save --- .github/workflows/auto-update-upgrade.yml | 9 +-------- scripts/check_release.sh | 6 +++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index e45663b6408..ad9ab100e00 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -9,15 +9,8 @@ on: release: types: [created] jobs: - check_release_version: - runs-on: ubuntu-latest - # this script will create a new temp.txt file and write 1 to it if a new version is major (major == in version vX.Y.Z changed X) - steps: - - name: Check is release is major - run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - post_release: - if: $(head -n 1 ./temp) == 1 + if: ${{ bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} }} == 1 runs-on: ubuntu-latest steps: - name: Checkout diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 96b848043da..fd10f404ec2 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -16,6 +16,6 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - touch ./temp.txt - echo 1 >> ./temp.txt -fi \ No newline at end of file + exit 1 +fi +exit 0 \ No newline at end of file From 1515062aac2c9b9fa7c5c6fe5e96e45624fb8c6a Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 10:55:43 +0700 Subject: [PATCH 064/106] save --- .github/workflows/auto-update-upgrade.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index ad9ab100e00..944ca2db54a 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,9 @@ on: types: [created] jobs: post_release: - if: ${{ bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} }} == 1 + env: + major_release: $(head -n 1 ./temp.txt) + if: ${{ env.major_release }} == 1 runs-on: ubuntu-latest steps: - name: Checkout From c2790b9c90c0ba2eaa2d2d53871b584eece33c0b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 10:57:25 +0700 Subject: [PATCH 065/106] save --- .github/workflows/auto-update-upgrade.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 944ca2db54a..a09aee90564 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,12 +12,13 @@ jobs: post_release: env: major_release: $(head -n 1 ./temp.txt) - if: ${{ env.major_release }} == 1 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - + + if: ${{ env.major_release }} == 1 + - name: Running script run: | bash ./scripts/empty_upgrade_handler_gen.sh From 59076afa9e39f8c23deb1929048715e0cfb3a3c0 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:02:39 +0700 Subject: [PATCH 066/106] Save --- .github/workflows/auto-update-upgrade.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index a09aee90564..f47433a86e1 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -7,7 +7,8 @@ name: On Release Auto Upgrade on: release: - types: [created] + types: [published] + jobs: post_release: env: @@ -18,7 +19,7 @@ jobs: uses: actions/checkout@v2.3.4 if: ${{ env.major_release }} == 1 - + - name: Running script run: | bash ./scripts/empty_upgrade_handler_gen.sh From 8195dad543627d3f3756981cd390c722b24747f3 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:07:14 +0700 Subject: [PATCH 067/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index f47433a86e1..93ac948939c 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -8,11 +8,11 @@ name: On Release Auto Upgrade on: release: types: [published] - + jobs: post_release: env: - major_release: $(head -n 1 ./temp.txt) + major_release: $(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}) runs-on: ubuntu-latest steps: - name: Checkout From 93b8d837a900a7b336a64d4241b3be53986bb3d1 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:10:59 +0700 Subject: [PATCH 068/106] save --- .github/workflows/auto-update-upgrade.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 93ac948939c..3caa26f968a 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -17,7 +17,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 - + + - name: CHECKS + run: echo ${{ env.major_release }} ${{ github.event.release.tag_name }} if: ${{ env.major_release }} == 1 - name: Running script From 1875254027c976258f676b6bc3187292703d2c7c Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:13:27 +0700 Subject: [PATCH 069/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- scripts/check_release.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 3caa26f968a..25156bba39e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo ${{ env.major_release }} ${{ github.event.release.tag_name }} + run: echo maj ${{ env.major_release }} if: ${{ env.major_release }} == 1 - name: Running script diff --git a/scripts/check_release.sh b/scripts/check_release.sh index fd10f404ec2..2119cb4408c 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -1,7 +1,6 @@ #!/bin/bash VERSION=$1 -echo $VERSION ÆAAAAAAAAAAA latest_version=0 for f in app/upgrades/*; do s_f=(${f//// }) From 6ba00ea3f85197f81e7e6152d09a80717d4b59a7 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:15:28 +0700 Subject: [PATCH 070/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 25156bba39e..0f7a705790a 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ on: jobs: post_release: env: - major_release: $(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}) + major_release: ($(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})) runs-on: ubuntu-latest steps: - name: Checkout From fd63c09a1fcb433cb3150c1fb9b1c37c6ae4fcd4 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:51:51 +0700 Subject: [PATCH 071/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- scripts/check_release.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 0f7a705790a..412dfc09b32 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ on: jobs: post_release: env: - major_release: ($(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})) + major_release: ${{ GITHUB_ENV.major }} runs-on: ubuntu-latest steps: - name: Checkout diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 2119cb4408c..6d76915c3ab 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -15,6 +15,6 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - exit 1 + echo "major=1" >> $GITHUB_ENV fi -exit 0 \ No newline at end of file +echo "major=0" >> $GITHUB_ENV \ No newline at end of file From a0252df4bd51e2b800f21635cd4e4c315deb960b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:54:02 +0700 Subject: [PATCH 072/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 412dfc09b32..2d086d5f846 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -12,7 +12,7 @@ on: jobs: post_release: env: - major_release: ${{ GITHUB_ENV.major }} + major_release: $GITHUB_ENV.major runs-on: ubuntu-latest steps: - name: Checkout From b5d80cc02322e86f714d0761a904b2961c5c0484 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:55:55 +0700 Subject: [PATCH 073/106] save --- .github/workflows/auto-update-upgrade.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 2d086d5f846..e68b277e488 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -11,16 +11,15 @@ on: jobs: post_release: - env: - major_release: $GITHUB_ENV.major runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECKS - run: echo maj ${{ env.major_release }} - if: ${{ env.major_release }} == 1 + run: echo maj $GITHUB_ENV.major + + - if: ${{ env.major_release }} == 1 - name: Running script run: | From 15175fdecf8aebe35c2888956de91623f0fe26f7 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 11:58:11 +0700 Subject: [PATCH 074/106] save --- .github/workflows/auto-update-upgrade.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index e68b277e488..efe1f765ea3 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -18,15 +18,13 @@ jobs: - name: CHECKS run: echo maj $GITHUB_ENV.major - + - if: ${{ env.major_release }} == 1 - - name: Running script + - name: Running script + create PR run: | bash ./scripts/empty_upgrade_handler_gen.sh rm -rf ./temp - - - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: base: ${{ github.event.repository.default_branch }} @@ -37,4 +35,4 @@ jobs: labels: | T:auto C:e2e - C:app-wiring + C:app-wiring \ No newline at end of file From 18eb02b9c68cb2c0fe9138ccd2472dc6dbdc95f3 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:00:55 +0700 Subject: [PATCH 075/106] save --- .github/workflows/auto-update-upgrade.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index efe1f765ea3..b1541d74688 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,6 +10,11 @@ on: types: [published] jobs: + check_for_major_version: + runs-on: ubuntu-latest + steps: + - run: bash ./scripts/check_release.sh + post_release: runs-on: ubuntu-latest steps: @@ -19,7 +24,7 @@ jobs: - name: CHECKS run: echo maj $GITHUB_ENV.major - - if: ${{ env.major_release }} == 1 + # - if: ${{ env.major_release }} == 1 - name: Running script + create PR run: | From 1674b6477d422aa51a88a9df99559e8518328bb4 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:02:24 +0700 Subject: [PATCH 076/106] save --- .github/workflows/auto-update-upgrade.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b1541d74688..8665fdcd104 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - run: bash ./scripts/check_release.sh - + post_release: runs-on: ubuntu-latest steps: @@ -30,6 +30,8 @@ jobs: run: | bash ./scripts/empty_upgrade_handler_gen.sh rm -rf ./temp + + - name: Create PR uses: peter-evans/create-pull-request@v4 with: base: ${{ github.event.repository.default_branch }} From 0d35e89170b68d0b1989e33259bc7bd0f3ed9e0b Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:04:11 +0700 Subject: [PATCH 077/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 8665fdcd104..81f526e5672 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -13,7 +13,7 @@ jobs: check_for_major_version: runs-on: ubuntu-latest steps: - - run: bash ./scripts/check_release.sh + - run: bash scripts/check_release.sh {{ github.event.release.tag_name }} post_release: runs-on: ubuntu-latest From 0249476cbeb6473a9379e18a7fed476c3223c138 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:07:45 +0700 Subject: [PATCH 078/106] save --- .github/workflows/auto-update-upgrade.yml | 3 ++- scripts/check_release.sh | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 81f526e5672..785592b1264 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -13,7 +13,8 @@ jobs: check_for_major_version: runs-on: ubuntu-latest steps: - - run: bash scripts/check_release.sh {{ github.event.release.tag_name }} + - run: echo $(pwd) + - run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} post_release: runs-on: ubuntu-latest diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 6d76915c3ab..46fdf5680b5 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -16,5 +16,4 @@ VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then echo "major=1" >> $GITHUB_ENV -fi -echo "major=0" >> $GITHUB_ENV \ No newline at end of file +fi \ No newline at end of file From d66671117520d75eb2397d3e2658ef1b40118ad5 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:09:19 +0700 Subject: [PATCH 079/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 785592b1264..34204dd3f25 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -13,7 +13,7 @@ jobs: check_for_major_version: runs-on: ubuntu-latest steps: - - run: echo $(pwd) + - run: echo $(ls -la) - run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} post_release: From e5f5723f5303b177fb494d58e2a42466fca754b3 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:12:49 +0700 Subject: [PATCH 080/106] save --- .github/workflows/auto-update-upgrade.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 34204dd3f25..2a467e56f78 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,22 +10,19 @@ on: types: [published] jobs: - check_for_major_version: - runs-on: ubuntu-latest - steps: - - run: echo $(ls -la) - - run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} - post_release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - + + - name: Run version script + run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} + - name: CHECKS - run: echo maj $GITHUB_ENV.major + run: echo maj ${GITHUB_ENV.major} - # - if: ${{ env.major_release }} == 1 + - if: ${{ env.major_release }} == 1 - name: Running script + create PR run: | From 93e84c8a2db544baf74e33b159725813cfa571df Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:14:35 +0700 Subject: [PATCH 081/106] save --- .github/workflows/auto-update-upgrade.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 2a467e56f78..d7aff9de373 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -23,11 +23,14 @@ jobs: run: echo maj ${GITHUB_ENV.major} - if: ${{ env.major_release }} == 1 - - - name: Running script + create PR run: | bash ./scripts/empty_upgrade_handler_gen.sh rm -rf ./temp + + # - name: Running script + create PR + # run: | + # bash ./scripts/empty_upgrade_handler_gen.sh + # rm -rf ./temp - name: Create PR uses: peter-evans/create-pull-request@v4 From 89ce36c6fa78f34d594f0312da0af4007aada6c5 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:19:31 +0700 Subject: [PATCH 082/106] save --- .github/workflows/auto-update-upgrade.yml | 13 +++---------- scripts/check_release.sh | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index d7aff9de373..b2c0024726c 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -20,18 +20,11 @@ jobs: run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} - name: CHECKS - run: echo maj ${GITHUB_ENV.major} + run: echo maj $GITHUB_ENV.is_major - - if: ${{ env.major_release }} == 1 - run: | - bash ./scripts/empty_upgrade_handler_gen.sh - rm -rf ./temp + - if: $GITHUB_ENV.is_major == 1 + run: bash ./scripts/empty_upgrade_handler_gen.sh - # - name: Running script + create PR - # run: | - # bash ./scripts/empty_upgrade_handler_gen.sh - # rm -rf ./temp - - name: Create PR uses: peter-evans/create-pull-request@v4 with: diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 46fdf5680b5..6fe7bbcf97f 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -15,5 +15,5 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - echo "major=1" >> $GITHUB_ENV + echo "is_major=1" >> $GITHUB_ENV fi \ No newline at end of file From 2c17fab8b101bda34986e70b4ac4decdda29b596 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:28:08 +0700 Subject: [PATCH 083/106] save --- .github/workflows/auto-update-upgrade.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b2c0024726c..84eca091c5e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -16,14 +16,19 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - - name: Run version script - run: bash ./scripts/check_release.sh {{ github.event.release.tag_name }} + - name: Check for major version + uses: jungwinter/split@v2 + id: split + with: + msg: ${{ github.event.release.tag_name }} + separator: v + maxsplit: 2 - name: CHECKS - run: echo maj $GITHUB_ENV.is_major + run: echo ${{ steps.split.outputs._1 }} - - if: $GITHUB_ENV.is_major == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh + # - if: $GITHUB_ENV.is_major == 1 + - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR uses: peter-evans/create-pull-request@v4 From 68e456598e9c4ba0ae87ff51f77d71f6dbb8bf2f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:33:26 +0700 Subject: [PATCH 084/106] save --- .github/workflows/auto-update-upgrade.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 84eca091c5e..0cc71b7f8e8 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -16,16 +16,22 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - - name: Check for major version - uses: jungwinter/split@v2 + - name: Remove "v" from tag + uses: web3j/slice-action@v1.3 + id: slice + with: + value: ${{ github.event.release.tag_name }} + start: 1 + + - name: Get major version + uses: JungWinter/split@v2 id: split with: - msg: ${{ github.event.release.tag_name }} - separator: v - maxsplit: 2 + msg: ${{ steps.slice.output.result }} + separator: . - name: CHECKS - run: echo ${{ steps.split.outputs._1 }} + run: echo ${{ steps.split.outputs._0 }} # - if: $GITHUB_ENV.is_major == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh From 188fd00ac33f048e875305d4668834713f0a3e7e Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:35:50 +0700 Subject: [PATCH 085/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 0cc71b7f8e8..12d44fb2dec 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -27,7 +27,7 @@ jobs: uses: JungWinter/split@v2 id: split with: - msg: ${{ steps.slice.output.result }} + msg: ${{ steps.slice.outputs.result }} separator: . - name: CHECKS From ff432aaa67d1a6dad7d50e05d0f4bfe965d771cb Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:44:10 +0700 Subject: [PATCH 086/106] save --- .github/workflows/auto-update-upgrade.yml | 24 +++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 12d44fb2dec..dcc9e54eb63 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -30,10 +30,30 @@ jobs: msg: ${{ steps.slice.outputs.result }} separator: . + - name: Get previous tag + uses: WyriHaximus/github-action-get-previous-tag@v1 + id: pr_tag + with: + fallback: 1.0.0 + + - name: Remove "v" from pr_tag + uses: web3j/slice-action@v1.3 + id: pr_slice + with: + value: ${{ steps.pr_tag.outputs.tag }} + start: 1 + + - name: Get major version of pr_tag + uses: JungWinter/split@v2 + id: pr_split + with: + msg: ${{ steps.pr_slice.outputs.result }} + separator: . + - name: CHECKS - run: echo ${{ steps.split.outputs._0 }} + run: echo ${{ steps.pr_split.outputs._0 }} - # - if: $GITHUB_ENV.is_major == 1 + - if: ${{ steps.split.outputs._0 }} == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR From 26414d72b660f757689e2d17a3df8d7b6c92c4b9 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:45:24 +0700 Subject: [PATCH 087/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index dcc9e54eb63..010b461953f 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -53,7 +53,7 @@ jobs: - name: CHECKS run: echo ${{ steps.pr_split.outputs._0 }} - - if: ${{ steps.split.outputs._0 }} == 1 + # - if: ${{ steps.pr_split.outputs._0 }} == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR From e49ec37d22c1ff34025cb775048bb53de4fbdb36 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:55:53 +0700 Subject: [PATCH 088/106] save --- .github/workflows/auto-update-upgrade.yml | 39 +++-------------------- scripts/check_release.sh | 2 +- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 010b461953f..a95c21ebb95 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -15,43 +15,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 - - - name: Remove "v" from tag - uses: web3j/slice-action@v1.3 - id: slice - with: - value: ${{ github.event.release.tag_name }} - start: 1 - - - name: Get major version - uses: JungWinter/split@v2 - id: split - with: - msg: ${{ steps.slice.outputs.result }} - separator: . - - - name: Get previous tag - uses: WyriHaximus/github-action-get-previous-tag@v1 - id: pr_tag - with: - fallback: 1.0.0 - - - name: Remove "v" from pr_tag - uses: web3j/slice-action@v1.3 - id: pr_slice - with: - value: ${{ steps.pr_tag.outputs.tag }} - start: 1 - - - name: Get major version of pr_tag - uses: JungWinter/split@v2 - id: pr_split - with: - msg: ${{ steps.pr_slice.outputs.result }} - separator: . + + - name: Run version script + run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - name: CHECKS - run: echo ${{ steps.pr_split.outputs._0 }} + run: echo ${{ GITHUB_ENV.major }} # - if: ${{ steps.pr_split.outputs._0 }} == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 6fe7bbcf97f..46fdf5680b5 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -15,5 +15,5 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - echo "is_major=1" >> $GITHUB_ENV + echo "major=1" >> $GITHUB_ENV fi \ No newline at end of file From 2cbd42228da68e0c6e6c2cbbf9917bd8af6e417f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:56:59 +0700 Subject: [PATCH 089/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index a95c21ebb95..2d356461aea 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -15,12 +15,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 - + - name: Run version script run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - name: CHECKS - run: echo ${{ GITHUB_ENV.major }} + run: echo $GITHUB_ENV.major # - if: ${{ steps.pr_split.outputs._0 }} == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh From 72e0d6dd921d86a0cf6c368e881c5b0194e7af20 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 12:58:35 +0700 Subject: [PATCH 090/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 2d356461aea..338ef1a79e2 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -22,8 +22,8 @@ jobs: - name: CHECKS run: echo $GITHUB_ENV.major - # - if: ${{ steps.pr_split.outputs._0 }} == 1 - - run: bash ./scripts/empty_upgrade_handler_gen.sh + - if: ${{ steps.pr_split.outputs._0 }} == 1 + run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR uses: peter-evans/create-pull-request@v4 From 752369391f833611e77dd5202cf8e13723438d51 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:03:25 +0700 Subject: [PATCH 091/106] save --- .github/workflows/auto-update-upgrade.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 338ef1a79e2..79369ec2550 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,7 +10,7 @@ on: types: [published] jobs: - post_release: + version_check: runs-on: ubuntu-latest steps: - name: Checkout @@ -18,12 +18,14 @@ jobs: - name: Run version script run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} + post_release: + if: $GITHUB_ENV.major == 1 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 - - name: CHECKS - run: echo $GITHUB_ENV.major - - - if: ${{ steps.pr_split.outputs._0 }} == 1 - run: bash ./scripts/empty_upgrade_handler_gen.sh + - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR uses: peter-evans/create-pull-request@v4 From 51070f9e695615b48c5f565149adbb8bf51bbda0 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:06:58 +0700 Subject: [PATCH 092/106] save --- .github/workflows/auto-update-upgrade.yml | 4 +++- scripts/check_release.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 79369ec2550..f90507b74ea 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run version script - run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} + run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: if: $GITHUB_ENV.major == 1 runs-on: ubuntu-latest @@ -25,6 +25,8 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 + - name: CHECK + run: echo $GITHUB_ENV.major - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 46fdf5680b5..1f61babc804 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -15,5 +15,5 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - echo "major=1" >> $GITHUB_ENV + exit 1 fi \ No newline at end of file From 804ed593e60f131f7843d60e557116e3f15277ea Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:07:32 +0700 Subject: [PATCH 093/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index f90507b74ea..5663234dd54 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,14 +19,14 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: - if: $GITHUB_ENV.major == 1 + if: $env.major == 1 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECK - run: echo $GITHUB_ENV.major + run: echo $env.major - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR From e6a391ae3fb9a6b30bdb3726868695b7ec80e522 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:09:06 +0700 Subject: [PATCH 094/106] save --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 5663234dd54..ac865639c04 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,14 +19,14 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: - if: $env.major == 1 + if: ${{ env.major }} == 1 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 - name: CHECK - run: echo $env.major + run: echo ${{ env.major }} - run: bash ./scripts/empty_upgrade_handler_gen.sh - name: Create PR From 5cc4830d92860d36b6dd6acc27f1d7fe4591e171 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:19:31 +0700 Subject: [PATCH 095/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index ac865639c04..0983806b62e 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,7 +19,7 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: - if: ${{ env.major }} == 1 + # if: ${{ env.major }} == 1 runs-on: ubuntu-latest steps: - name: Checkout From a0cf16126db09b4f632698a1e67f4e559714a624 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:21:42 +0700 Subject: [PATCH 096/106] save --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 0983806b62e..ba7b02caa1d 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,7 +19,7 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: - # if: ${{ env.major }} == 1 + if: env.major == 1 runs-on: ubuntu-latest steps: - name: Checkout From 7345f3f31d6ba35265777351631e4c2e7ec7f44d Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:23:50 +0700 Subject: [PATCH 097/106] save --- .github/workflows/auto-update-upgrade.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index ba7b02caa1d..b23cdd5a77b 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,7 +19,6 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: - if: env.major == 1 runs-on: ubuntu-latest steps: - name: Checkout @@ -27,7 +26,11 @@ jobs: - name: CHECK run: echo ${{ env.major }} - - run: bash ./scripts/empty_upgrade_handler_gen.sh + + - name: Run post release script + if: env.major == 1 + run: bash ./scripts/empty_upgrade_handler_gen.sh + - name: Create PR uses: peter-evans/create-pull-request@v4 From de49b17a476e0cbd42c469f01c801d4f8db20155 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:26:24 +0700 Subject: [PATCH 098/106] save --- .github/workflows/auto-update-upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index b23cdd5a77b..28fb21e41b6 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -19,6 +19,7 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV post_release: + needs: version_check runs-on: ubuntu-latest steps: - name: Checkout From 248619b18164b4b251c8c43abf881c678b17b641 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:27:39 +0700 Subject: [PATCH 099/106] save --- .github/workflows/auto-update-upgrade.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 28fb21e41b6..bfdbac115a8 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -18,6 +18,9 @@ jobs: - name: Run version script run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV + + - name: CHECK + run: echo ${{ env.major }} post_release: needs: version_check runs-on: ubuntu-latest From 2f04f1ba45ff87665f1544053a3890a675e33aa5 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:56:49 +0700 Subject: [PATCH 100/106] s --- .github/workflows/auto-update-upgrade.yml | 2 +- scripts/check_release.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index bfdbac115a8..f90bd058461 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run version script - run: echo "major=$(bash ./scripts/check_release.sh ${{ github.event.release.tag_name }})" >> $GITHUB_ENV + run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}) - name: CHECK run: echo ${{ env.major }} diff --git a/scripts/check_release.sh b/scripts/check_release.sh index 1f61babc804..d2742e99f02 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -15,5 +15,5 @@ VERSION=${VERSION[@]:1} VERSION_MAJOR=(${VERSION//./ }) VERSION_MAJOR=${VERSION_MAJOR[0]} if [[ $VERSION_MAJOR -gt $latest_version ]]; then - exit 1 + echo "MAJOR=1" >> $GITHUB_ENV fi \ No newline at end of file From 4b4ec877e241010a66c94a8888291dadfdec107d Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:57:12 +0700 Subject: [PATCH 101/106] s --- .github/workflows/auto-update-upgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index f90bd058461..af2746b652b 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -20,7 +20,7 @@ jobs: run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}) - name: CHECK - run: echo ${{ env.major }} + run: echo ${{ env.MAJOR }} post_release: needs: version_check runs-on: ubuntu-latest @@ -32,7 +32,7 @@ jobs: run: echo ${{ env.major }} - name: Run post release script - if: env.major == 1 + if: env.MAJOR == 1 run: bash ./scripts/empty_upgrade_handler_gen.sh From 1b44e5a99f2e794e87f415fb2fc7b615699acd92 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:58:08 +0700 Subject: [PATCH 102/106] s --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index af2746b652b..05961646f05 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: CHECK - run: echo ${{ env.major }} + run: echo ${{ env.MAJOR }} - name: Run post release script if: env.MAJOR == 1 From 045f3f4c01ffcd4447a539ba0f413ee1335f50d3 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 13:59:59 +0700 Subject: [PATCH 103/106] s --- .github/workflows/auto-update-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 05961646f05..4a4d20bda73 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run version script - run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }}) + run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - name: CHECK run: echo ${{ env.MAJOR }} From 3bb7234003e44396acdd54c46ac8fd92ed651b44 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 14:02:06 +0700 Subject: [PATCH 104/106] s --- .github/workflows/auto-update-upgrade.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 4a4d20bda73..cb720d42dc7 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -10,24 +10,27 @@ on: types: [published] jobs: - version_check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.3.4 + # version_check: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v2.3.4 - - name: Run version script - run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} + # - name: Run version script + # run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - - name: CHECK - run: echo ${{ env.MAJOR }} + # - name: CHECK + # run: echo ${{ env.MAJOR }} post_release: - needs: version_check + # needs: version_check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.3.4 + - name: Run version script + run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} + - name: CHECK run: echo ${{ env.MAJOR }} From 1f5621035f96bb8da7f89563b839993b1e6c10f6 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 14:05:25 +0700 Subject: [PATCH 105/106] only on major upgrades --- .github/workflows/auto-update-upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index cb720d42dc7..4d9b62e5418 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -40,6 +40,7 @@ jobs: - name: Create PR + if: env.MAJOR == 1 uses: peter-evans/create-pull-request@v4 with: base: ${{ github.event.repository.default_branch }} From 9beb3ae8ac0c3fed1246e7f795608b36862d7f36 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Tue, 25 Oct 2022 14:10:16 +0700 Subject: [PATCH 106/106] docs --- .github/workflows/auto-update-upgrade.yml | 20 ++------------------ scripts/check_release.sh | 2 ++ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/auto-update-upgrade.yml b/.github/workflows/auto-update-upgrade.yml index 4d9b62e5418..aee6de935b8 100644 --- a/.github/workflows/auto-update-upgrade.yml +++ b/.github/workflows/auto-update-upgrade.yml @@ -1,4 +1,4 @@ -# When new release is created this workflow will be triggered and will do 3 things: +# When new major release is created this workflow will be triggered and will do 3 things: # 1) it will create a directory with an empty upgrade handler in app/upgrades folder # 2) will increase an E2E_UPGRADE_VERSION variable in Makefile # 3) create a pull request with these changes to main @@ -10,19 +10,7 @@ on: types: [published] jobs: - # version_check: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2.3.4 - - # - name: Run version script - # run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - - # - name: CHECK - # run: echo ${{ env.MAJOR }} post_release: - # needs: version_check runs-on: ubuntu-latest steps: - name: Checkout @@ -31,14 +19,10 @@ jobs: - name: Run version script run: bash ./scripts/check_release.sh ${{ github.event.release.tag_name }} - - name: CHECK - run: echo ${{ env.MAJOR }} - - name: Run post release script - if: env.MAJOR == 1 + if: env.MAJOR == 1 # 1 means vX of existing upgrade handler is smaller than A in tag vA.B.C run: bash ./scripts/empty_upgrade_handler_gen.sh - - name: Create PR if: env.MAJOR == 1 uses: peter-evans/create-pull-request@v4 diff --git a/scripts/check_release.sh b/scripts/check_release.sh index d2742e99f02..befaeaf8ed8 100644 --- a/scripts/check_release.sh +++ b/scripts/check_release.sh @@ -1,3 +1,5 @@ +# this script checks if existing upgrade handler's version is not smaller than current release + #!/bin/bash VERSION=$1