Add ModCheckTest to test runtime mod validations and entry point superclass checks. Include Gradle verification metadata for dependency integrity.
This commit is contained in:
1 parent
18ff32b5ce
commit
6761f2d9ea
29 files changed
+1306
-72
No files matched your search
+40
-21
@@ -7,10 +7,13 @@
|
||||
# A pre-release version (containing "-", e.g. 0.3.0-rc.1) is built and tested but never
|
||||
# published. Without a v* tag on HEAD nothing is published.
|
||||
#
|
||||
# Environment:
|
||||
# Usage:
|
||||
# ci/publish.sh test runs the checks of the published modules; needs no credentials
|
||||
# ci/publish.sh publish publishes them without running the checks again
|
||||
#
|
||||
# Environment (publish only):
|
||||
# ORG_GRADLE_PROJECT_giteaUsername Gitea user with package write access
|
||||
# ORG_GRADLE_PROJECT_giteaPassword Token of that user
|
||||
# PUBLISH true: publish after the tests. Default: false (test only)
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
@@ -19,8 +22,6 @@ set -o pipefail
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
readonly REPO_ROOT
|
||||
|
||||
readonly REQUESTED_PUBLISH="${PUBLISH:-false}"
|
||||
|
||||
readonly MODULES=(
|
||||
api
|
||||
mod-tools
|
||||
@@ -61,36 +62,54 @@ run_gradle() {
|
||||
"$@"
|
||||
}
|
||||
|
||||
main() {
|
||||
local version
|
||||
local publish="${REQUESTED_PUBLISH}"
|
||||
run_tests() {
|
||||
local version="$1"
|
||||
local check_tasks
|
||||
local publish_tasks
|
||||
|
||||
version="$(release_tag_version)"
|
||||
if [[ -z "${version}" ]]; then
|
||||
log "HEAD has no v* git tag (not a release commit, or a shallow clone without tags?); nothing to publish."
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${version}" == *-* ]]; then
|
||||
publish=false
|
||||
log "${version} is a pre-release version; nothing will be published."
|
||||
fi
|
||||
|
||||
mapfile -t check_tasks < <(module_tasks check)
|
||||
mapfile -t publish_tasks < <(module_tasks publishAllPublicationsToGiteaRepository)
|
||||
|
||||
log "Testing ZomboidForge ${version}: ${MODULES[*]}"
|
||||
run_gradle "${version}" :core:check "${check_tasks[@]}"
|
||||
}
|
||||
|
||||
if [[ "${publish}" != "true" ]]; then
|
||||
log "Not publishing (PUBLISH=${REQUESTED_PUBLISH})."
|
||||
publish() {
|
||||
local version="$1"
|
||||
local publish_tasks
|
||||
|
||||
if [[ "${version}" == *-* ]]; then
|
||||
log "${version} is a pre-release version; nothing is published."
|
||||
return
|
||||
fi
|
||||
|
||||
mapfile -t publish_tasks < <(module_tasks publishAllPublicationsToGiteaRepository)
|
||||
|
||||
log "Publishing ZomboidForge ${version}"
|
||||
run_gradle "${version}" "${publish_tasks[@]}"
|
||||
log "Published ${MODULES[*]} ${version}"
|
||||
}
|
||||
|
||||
main() {
|
||||
local step="${1:-}"
|
||||
local version
|
||||
|
||||
version="$(release_tag_version)"
|
||||
if [[ -z "${version}" ]]; then
|
||||
log "HEAD has no v* git tag (not a release commit, or a shallow clone without tags?); nothing to publish."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${step}" in
|
||||
test)
|
||||
run_tests "${version}"
|
||||
;;
|
||||
publish)
|
||||
publish "${version}"
|
||||
;;
|
||||
*)
|
||||
log "Usage: ci/publish.sh test|publish"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
+1
-1
@@ -14,7 +14,7 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
readonly APP_ID="380870"
|
||||
readonly STEAMCMD_IMAGE="docker.io/steamcmd/steamcmd:debian-13"
|
||||
readonly STEAMCMD_IMAGE="docker.io/steamcmd/steamcmd:debian-13@sha256:b0b49ef3101c304ed6e3fbc3ea930b2940d7c489563a1ebac524ad5bb46d336d"
|
||||
|
||||
readonly BRANCH="$1"
|
||||
|
||||
|
||||
Reference in new issue
Block a user