mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* chore: generate attestations during a release Signed-off-by: Justin Marquis <[email protected]> enable attestation for dockerhub Signed-off-by: Justin Marquis <[email protected]> release assests no longer compressed Signed-off-by: Justin Marquis <[email protected]> renamed attestion for cli Signed-off-by: Justin Marquis <[email protected]> updated docs to reflect non compressed cli binaries Signed-off-by: Justin Marquis <[email protected]> use quay username for provenance generator Signed-off-by: Justin Marquis <[email protected]> add check for TARGET_VERSION Signed-off-by: Justin Marquis <[email protected]> fixed typo Signed-off-by: Justin Marquis <[email protected]> updated go to 1.19 Signed-off-by: Justin Marquis <[email protected]> update cosign and slsa-github-generators Signed-off-by: Justin Marquis <[email protected]> update docs for cosignv2.0.0 Signed-off-by: Justin Marquis <[email protected]> remove docker registry from release Signed-off-by: Justin Marquis <[email protected]> * negate tags for v2.4,v2.5,v2.6 for release Signed-off-by: Justin Marquis <[email protected]> * bug fix for release notes Signed-off-by: Justin Marquis <[email protected]> --------- Signed-off-by: Justin Marquis <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
57 lines
1.7 KiB
Bash
Executable File
57 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This script requires bash shell - sorry.
|
|
|
|
NEW_TAG="${1}"
|
|
GIT_REMOTE="${2}"
|
|
|
|
set -ue
|
|
|
|
if test "${NEW_TAG}" = "" -o "${GIT_REMOTE}" = ""; then
|
|
echo "!! Usage: $0 <release tag> <remote>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Target (version) tag must match version scheme vMAJOR.MINOR.PATCH with an
|
|
# optional pre-release tag.
|
|
if ! echo "${NEW_TAG}" | egrep -q '^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then
|
|
echo "!! Malformed version tag: '${NEW_TAG}', must match 'vMAJOR.MINOR.PATCH(-rcX)'" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Check whether we are in correct branch of local repository
|
|
RELEASE_BRANCH="${NEW_TAG%\.[0-9]*}"
|
|
RELEASE_BRANCH="release-${RELEASE_BRANCH#*v}"
|
|
|
|
currentBranch=$(git branch --show-current)
|
|
if test "$currentBranch" != "${RELEASE_BRANCH}"; then
|
|
echo "!! Please checkout branch '${RELEASE_BRANCH}' (currently in branch: '${currentBranch}')" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo ">> Working in release branch '${RELEASE_BRANCH}'"
|
|
|
|
echo ">> Ensuring release branch is up to date."
|
|
# make sure release branch is up to date
|
|
git pull ${GIT_REMOTE} ${RELEASE_BRANCH}
|
|
|
|
# Check for target (version) tag in local repo
|
|
if git tag -l | grep -q -E "^${NEW_TAG}$"; then
|
|
echo "!! Target version tag '${NEW_TAG}' already exists in local repository" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Check for target (version) tag in remote repo
|
|
if git ls-remote ${GIT_REMOTE} refs/tags/${NEW_TAG} | grep -q -E "${NEW_TAG}$"; then
|
|
echo "!! Target version tag '${NEW_TAG}' already exists in remote '${GIT_REMOTE}'" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo ">> Creating new release '${NEW_TAG}' by pushing '${NEW_TAG}' to '${GIT_REMOTE}'"
|
|
|
|
# Create new tag in local repository
|
|
git tag ${NEW_TAG}
|
|
|
|
# Push the new tag to remote repository
|
|
git push ${GIT_REMOTE} ${NEW_TAG}
|