diff --git a/.github/workflows/dispatch.yaml b/.github/workflows/dispatch.yaml deleted file mode 100644 index 5b034b979..000000000 --- a/.github/workflows/dispatch.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: dispatch - -defaults: - run: - shell: bash - -on: - push: - -jobs: - dispatch-akash: - runs-on: ubuntu-latest - steps: - - name: notify goreleaser-cross with new release - uses: benc-uk/workflow-dispatch@v1 - with: - token: ${{ secrets.GORELEASER_ACCESS_TOKEN }} - repo: akash-network/homebrew-tap - workflow: akash - ref: refs/heads/main - inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 690057aef..967aa860a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,11 +92,9 @@ jobs: id: check run: | is_prerelease=$(./script/is_prerelease.sh ${{ env.RELEASE_TAG }}; echo $?) - is_mainnet=$(./script/mainnet-from-tag.sh ${{ env.RELEASE_TAG }}; echo $?) echo "is_prerelease=${is_prerelease}" >> $GITHUB_OUTPUT - echo "is_mainnet=${is_mainnet}" >> $GITHUB_OUTPUT - name: notify homebrew with a new release - if: contains(steps.check.outputs.is_mainnet, '0') && contains(steps.check.outputs.is_prerelease, '1') + if: steps.check.outputs.is_prerelease == '1' uses: benc-uk/workflow-dispatch@v1 with: token: ${{ secrets.GORELEASER_ACCESS_TOKEN }} diff --git a/Makefile b/Makefile index 225af3e74..876e0b3d2 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ GIT_HEAD_COMMIT_SHORT := $(shell git rev-parse --short HEAD) GIT_HEAD_ABBREV := $(shell git rev-parse --abbrev-ref HEAD) IS_PREREL := $(shell $(ROOT_DIR)/script/is_prerelease.sh "$(RELEASE_TAG)" && echo "true" || echo "false") -IS_MAINNET := $(shell $(ROOT_DIR)/script/mainnet-from-tag.sh "$(RELEASE_TAG)" && echo "true" || echo "false") IS_STABLE ?= false GO_LINKMODE ?= external @@ -25,10 +24,8 @@ GOMOD ?= readonly BUILD_TAGS ?= osusergo,netgo,hidraw,ledger GORELEASER_STRIP_FLAGS ?= -ifeq ($(IS_MAINNET), true) - ifeq ($(IS_PREREL), false) - IS_STABLE := true - endif +ifeq ($(IS_PREREL), false) + IS_STABLE := true endif GOMOD ?= readonly diff --git a/script/genchangelog.sh b/script/genchangelog.sh index 421a3d884..49a8eb531 100755 --- a/script/genchangelog.sh +++ b/script/genchangelog.sh @@ -2,17 +2,11 @@ # generated changelog depends on the tag type # only SEMVER tags are accounted -# there are two type of tag distinguished by minor part of the semver: -# - even number: mainnet -# - odd number: testnet -# net detection is done in section s1 # there are two type release notes generated # - prerelease: changelog between current and nearest lower prerelease (or previous release) # for example current tag v0.1.1-rc.10 and previous was v0.1.1-rc.9, so changelog is generated between # - release: changelog between current and previous release tags -# mainnet status is taken care as well. if current tag is edgenet (e.g. v0.1.1-rc.10) it -# will be generated to edgenet changes only PATH=$PATH:$(pwd)/.cache/bin export PATH=$PATH @@ -26,17 +20,11 @@ fi to_tag=$1 -# s1 -# shellcheck disable=SC1073 -if ! "${SCRIPT_DIR}"/mainnet-from-tag.sh "$to_tag" ; then - version_rel="^[v|V]?(0|[1-9][0-9]*)\\.(\\d*[13579])\\.(0|[1-9][0-9]*)$" - version_prerel="^[v|V]?(0|[1-9][0-9]*)\\.(\\d*[13579])\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" -else - version_rel="^[v|V]?(0|[1-9][0-9]*)\.(\d*[02468])\.(0|[1-9][0-9]*)$" - version_prerel="^[v|V]?(0|[1-9][0-9]*)\.(\d*[02468])\.(0|[1-9][0-9]*)(\-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$" -fi +source "${SCRIPT_DIR}/semver_funcs.sh" + +version_rel="^[vV]?($NAT)\.($NAT)\.($NAT)$" +version_prerel="$SEMVER_REGEX" -# s2 if [[ -z $("${SCRIPT_DIR}"/semver.sh get prerel "$to_tag") ]]; then tag_regexp=$version_rel else diff --git a/script/mainnet-from-tag.sh b/script/mainnet-from-tag.sh deleted file mode 100755 index 4976956c3..000000000 --- a/script/mainnet-from-tag.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# in akash even minor part of the tag indicates release belongs to the MAINNET -# using it as scripts simplifies debugging as well as portability -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" - -if [[ $# -ne 1 ]]; then - echo "illegal number of parameters" - exit 1 -fi - -[[ $(($("${SCRIPT_DIR}"/semver.sh get minor "$1") % 2)) -eq 0 ]] && exit 0 && exit 1