Skip to content
Snippets Groups Projects
Commit 11b1bf23 authored by gabriel klawitter's avatar gabriel klawitter Committed by Gavin Wood
Browse files

ci: fix release tagging after tags are added on the master branch (#714)

* ci: fix release tagging after tags are added on the master branch

* ci: latest tag applied to latest tag
parent 49748172
No related merge requests found
......@@ -176,18 +176,13 @@ build-linux-release: &build
- mkdir -p ./artifacts
- mv ./target/release/polkadot ./artifacts/.
- sha256sum ./artifacts/polkadot | tee ./artifacts/polkadot.sha256
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
- if [ "${CI_COMMIT_TAG}" ]; then
VERSION="${CI_COMMIT_TAG}";
else
VERSION="$(./artifacts/polkadot --version |
sed -n -r 's/^polkadot ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p')";
VERSION="${VERSION}-$(cut -c 1-8 ./artifacts/polkadot.sha256)";
fi
- LATEST_BRANCH="$(ls -1 .git/refs/remotes/origin/ | sed -r -n 's:v([0-9]+)\.([0-9]+):v\1.\2:p' | sort -V | tail -n1)"
- if expr match x${CI_COMMIT_TAG} x${LATEST_BRANCH}; then
EXTRATAG="latest";
else
EXTRATAG="latest-${CI_COMMIT_REF_NAME}";
EXTRATAG="$(./artifacts/polkadot --version |
sed -n -r 's/^polkadot ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p')";
EXTRATAG="${CI_COMMIT_REF_NAME}-${EXTRATAG}-$(cut -c 1-8 ./artifacts/polkadot.sha256)";
fi
- echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})"
- echo -n ${VERSION} > ./artifacts/VERSION
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment