mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 18:06:19 +02:00
Compare commits
1 Commits
ca71f65daa
...
unstable
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d7c7074457 |
@@ -7,6 +7,8 @@ _DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
|
|||||||
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
|
||||||
# shellcheck source=src/lib/valid-tags.sh
|
# shellcheck source=src/lib/valid-tags.sh
|
||||||
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-tags.sh
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-tags.sh
|
||||||
|
# shellcheck source=src/lib/util/git.sh
|
||||||
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/git.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -55,8 +57,8 @@ gittag=$(get_tag_from_pkgver "$pkgver")
|
|||||||
if ! branchname=$(git symbolic-ref --short HEAD); then
|
if ! branchname=$(git symbolic-ref --short HEAD); then
|
||||||
die 'not on any branch'
|
die 'not on any branch'
|
||||||
fi
|
fi
|
||||||
if [[ "${branchname}" != main ]]; then
|
if ! is_valid_release_branch "${branchname}"; then
|
||||||
die 'must be run from the main branch'
|
die 'must be run from a valid release branch (%s)' "${VALID_RELEASE_BRANCHES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if remote origin is setup properly
|
# Check if remote origin is setup properly
|
||||||
@@ -85,10 +87,10 @@ if git tag --verify "$gittag" &> /dev/null; then
|
|||||||
if [[ "$cwd_checksum" != "$tag_checksum" ]]; then
|
if [[ "$cwd_checksum" != "$tag_checksum" ]]; then
|
||||||
die "tagged PKGBUILD is not the same as the working dir PKGBUILD"
|
die "tagged PKGBUILD is not the same as the working dir PKGBUILD"
|
||||||
fi
|
fi
|
||||||
git push --tags --set-upstream origin main || abort
|
git push --tags --set-upstream origin "${branchname}" || abort
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg "Releasing package"
|
msg "Releasing package"
|
||||||
git tag --sign --message="Package release ${pkgver}" "$gittag" || abort
|
git tag --sign --message="Package release ${pkgver}" "$gittag" || abort
|
||||||
git push --tags --set-upstream origin main || abort
|
git push --tags --set-upstream origin "${branchname}" || abort
|
||||||
|
@@ -5,6 +5,8 @@
|
|||||||
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
|
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
|
||||||
# shellcheck source=src/lib/common.sh
|
# shellcheck source=src/lib/common.sh
|
||||||
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
|
||||||
|
# shellcheck source=src/lib/util/git.sh
|
||||||
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/git.sh
|
||||||
|
|
||||||
source /usr/share/makepkg/util/util.sh
|
source /usr/share/makepkg/util/util.sh
|
||||||
|
|
||||||
@@ -70,8 +72,12 @@ if ! repo_spec=$(git config --local devtools.version) || [[ ${repo_spec} != "${G
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$(git symbolic-ref --short HEAD)" != main ]]; then
|
if ! branchname=$(git symbolic-ref --short HEAD); then
|
||||||
die 'must be run from the main branch'
|
die 'not on any branch'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! is_valid_release_branch "${branchname}"; then
|
||||||
|
die 'must be run from a valid release branch (%s)' "${VALID_RELEASE_BRANCHES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source=()
|
source=()
|
||||||
@@ -95,6 +101,9 @@ case "$cmd" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [[ "${branchname}" == "unstable" ]] && [[ "$repo" != *"unstable" ]]; then
|
||||||
|
die 'Cannot release from unstable branch into non-unstable repo: %s' "${repo}"
|
||||||
|
fi
|
||||||
|
|
||||||
if (( ${#validpgpkeys[@]} != 0 )); then
|
if (( ${#validpgpkeys[@]} != 0 )); then
|
||||||
if [[ -d keys ]]; then
|
if [[ -d keys ]]; then
|
||||||
|
@@ -29,6 +29,8 @@ export GIT_PACKAGING_URL_SSH="git@${GITLAB_HOST}:${GIT_PACKAGING_NAMESPACE}"
|
|||||||
export GIT_PACKAGING_URL_HTTPS="https://${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}"
|
export GIT_PACKAGING_URL_HTTPS="https://${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}"
|
||||||
export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org
|
export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org
|
||||||
|
|
||||||
|
export VALID_RELEASE_BRANCHES=(main unstable)
|
||||||
|
|
||||||
# check if messages are to be printed using color
|
# check if messages are to be printed using color
|
||||||
if [[ -t 2 && "$TERM" != dumb ]] || [[ ${DEVTOOLS_COLOR} == always ]]; then
|
if [[ -t 2 && "$TERM" != dumb ]] || [[ ${DEVTOOLS_COLOR} == always ]]; then
|
||||||
colorize
|
colorize
|
||||||
|
@@ -22,3 +22,8 @@ git_diff_tree() {
|
|||||||
"${commit}" \
|
"${commit}" \
|
||||||
-- "${path}"
|
-- "${path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_valid_release_branch() {
|
||||||
|
local branch=$1
|
||||||
|
in_array "${branch}" "${VALID_RELEASE_BRANCHES[@]}"
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user