mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
change versioning and tagging of releases (#476)
* change versioning and tagging of releases
This commit is contained in:
committed by
GitHub
parent
78fc9edd5f
commit
b890df6cde
+17
-11
@@ -137,6 +137,20 @@ build-linux-release: &build
|
|||||||
cache: {}
|
cache: {}
|
||||||
<<: *build-refs
|
<<: *build-refs
|
||||||
<<: *kubernetes-env
|
<<: *kubernetes-env
|
||||||
|
before_script:
|
||||||
|
- test -s ./artifacts/VERSION || exit 1
|
||||||
|
- 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 [ "${CI_COMMIT_TAG}" ]; then
|
||||||
|
VERSION="${CI_COMMIT_TAG}";
|
||||||
|
else
|
||||||
|
VERSION="$(cat ./artifacts/VERSION)-$(cut -c 1-8 ./artifacts/polkadot.sha256)";
|
||||||
|
fi
|
||||||
|
- if expr match x${CI_COMMIT_TAG} x${LATEST_BRANCH}; then
|
||||||
|
EXTRATAG="latest";
|
||||||
|
else
|
||||||
|
EXTRATAG="latest-${CI_COMMIT_REF_NAME}";
|
||||||
|
fi
|
||||||
|
- echo "Polkadot version = ${VERSION} (TAG ${EXTRATAG})"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -153,16 +167,11 @@ publish-docker-release:
|
|||||||
GIT_STRATEGY: none
|
GIT_STRATEGY: none
|
||||||
# DOCKERFILE: scripts/docker/Dockerfile
|
# DOCKERFILE: scripts/docker/Dockerfile
|
||||||
CONTAINER_IMAGE: parity/polkadot
|
CONTAINER_IMAGE: parity/polkadot
|
||||||
before_script:
|
script:
|
||||||
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity"
|
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity"
|
||||||
|| ( echo "no docker credentials provided"; exit 1 )
|
|| ( echo "no docker credentials provided"; exit 1 )
|
||||||
- docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity"
|
- docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity"
|
||||||
- docker info
|
- docker info
|
||||||
script:
|
|
||||||
- VERSION="$(cat ./artifacts/VERSION)"
|
|
||||||
- EXTRATAG="${CI_COMMIT_TAG:-latest}"
|
|
||||||
- echo "Polkadot version = ${VERSION}"
|
|
||||||
- test -z "${VERSION}" && exit 1
|
|
||||||
- cd ./artifacts
|
- cd ./artifacts
|
||||||
- docker build
|
- docker build
|
||||||
--build-arg VCS_REF="${CI_COMMIT_SHA}"
|
--build-arg VCS_REF="${CI_COMMIT_SHA}"
|
||||||
@@ -187,19 +196,16 @@ publish-s3-release:
|
|||||||
BUCKET: "releases.parity.io"
|
BUCKET: "releases.parity.io"
|
||||||
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
|
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
|
||||||
script:
|
script:
|
||||||
- VERSION="${CI_COMMIT_TAG:-$(cat ./artifacts/VERSION)}"
|
|
||||||
# LATEST_BRANCH will be empty if it's not a tag build i.e. CI_COMMIT_TAG is unset
|
|
||||||
- LATEST_BRANCH="$(echo $CI_COMMIT_TAG | sed -n -r 's/^(v[0-9]+\.[0-9]+)\.[0-9]+$/\1/p')"
|
|
||||||
- aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/${VERSION}/
|
- aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/${VERSION}/
|
||||||
- echo "update objects in latest path"
|
- echo "update objects in latest path"
|
||||||
- for file in ./artifacts/*; do
|
- for file in ./artifacts/*; do
|
||||||
name="$(basename ${file})";
|
name="$(basename ${file})";
|
||||||
aws s3api copy-object
|
aws s3api copy-object
|
||||||
--copy-source ${BUCKET}/${PREFIX}/${VERSION}/${name}
|
--copy-source ${BUCKET}/${PREFIX}/${VERSION}/${name}
|
||||||
--bucket ${BUCKET} --key ${PREFIX}/latest${LATEST_BRANCH}/${name};
|
--bucket ${BUCKET} --key ${PREFIX}/${EXTRATAG}/${name};
|
||||||
done
|
done
|
||||||
after_script:
|
after_script:
|
||||||
- aws s3 ls s3://${BUCKET}/${PREFIX}/latest${LATEST_BRANCH}/
|
- aws s3 ls s3://${BUCKET}/${PREFIX}/${EXTRATAG}/
|
||||||
--recursive --human-readable --summarize
|
--recursive --human-readable --summarize
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user