2022-06-09 10:30:53 +00:00
|
|
|
PRE_RELEASE_VERSION ?=
|
2021-10-17 17:15:44 +00:00
|
|
|
|
2021-11-24 18:10:52 +00:00
|
|
|
RELEASE_MANIFEST_FILE ?=
|
|
|
|
RELEASE_CHGLOG_DESC_FILE ?=
|
|
|
|
|
|
|
|
REPOTOOLS_VERSION ?= latest
|
|
|
|
REPOTOOLS_MODULE = github.com/awslabs/aws-go-multi-module-repository-tools
|
|
|
|
REPOTOOLS_CMD_CALCULATE_RELEASE = ${REPOTOOLS_MODULE}/cmd/calculaterelease@${REPOTOOLS_VERSION}
|
2022-06-09 10:30:53 +00:00
|
|
|
REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS ?=
|
2021-11-24 18:10:52 +00:00
|
|
|
REPOTOOLS_CMD_UPDATE_REQUIRES = ${REPOTOOLS_MODULE}/cmd/updaterequires@${REPOTOOLS_VERSION}
|
|
|
|
REPOTOOLS_CMD_UPDATE_MODULE_METADATA = ${REPOTOOLS_MODULE}/cmd/updatemodulemeta@${REPOTOOLS_VERSION}
|
|
|
|
REPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${REPOTOOLS_VERSION}
|
|
|
|
REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION}
|
|
|
|
REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION}
|
|
|
|
REPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION}
|
|
|
|
|
2022-06-09 10:30:53 +00:00
|
|
|
ifneq ($(PRE_RELEASE_VERSION),)
|
|
|
|
REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION}
|
|
|
|
endif
|
|
|
|
|
2021-10-17 17:15:44 +00:00
|
|
|
smithy-publish-local:
|
|
|
|
cd codegen && ./gradlew publishToMavenLocal
|
|
|
|
|
|
|
|
smithy-build:
|
|
|
|
cd codegen && ./gradlew build
|
|
|
|
|
|
|
|
smithy-clean:
|
|
|
|
cd codegen && ./gradlew clean
|
2021-11-24 18:10:52 +00:00
|
|
|
|
|
|
|
#####################
|
|
|
|
# Release Process #
|
|
|
|
#####################
|
|
|
|
.PHONY: preview-release pre-release-validation release
|
|
|
|
|
|
|
|
preview-release:
|
2022-06-09 10:30:53 +00:00
|
|
|
go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS}
|
2021-11-24 18:10:52 +00:00
|
|
|
|
|
|
|
pre-release-validation:
|
|
|
|
@if [[ -z "${RELEASE_MANIFEST_FILE}" ]]; then \
|
|
|
|
echo "RELEASE_MANIFEST_FILE is required to specify the file to write the release manifest" && false; \
|
|
|
|
fi
|
|
|
|
@if [[ -z "${RELEASE_CHGLOG_DESC_FILE}" ]]; then \
|
|
|
|
echo "RELEASE_CHGLOG_DESC_FILE is required to specify the file to write the release notes" && false; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
release: pre-release-validation
|
2022-06-09 10:30:53 +00:00
|
|
|
go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} -o ${RELEASE_MANIFEST_FILE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS}
|
2021-11-24 18:10:52 +00:00
|
|
|
go run ${REPOTOOLS_CMD_UPDATE_REQUIRES} -release ${RELEASE_MANIFEST_FILE}
|
|
|
|
go run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} -release ${RELEASE_MANIFEST_FILE}
|
|
|
|
go run ${REPOTOOLS_CMD_GENERATE_CHANGELOG} -release ${RELEASE_MANIFEST_FILE} -o ${RELEASE_CHGLOG_DESC_FILE}
|
|
|
|
go run ${REPOTOOLS_CMD_CHANGELOG} rm -all
|
|
|
|
go run ${REPOTOOLS_CMD_TAG_RELEASE} -release ${RELEASE_MANIFEST_FILE}
|
|
|
|
|
|
|
|
module-version:
|
|
|
|
@go run ${REPOTOOLS_CMD_MODULE_VERSION} .
|
|
|
|
|
|
|
|
##############
|
|
|
|
# Repo Tools #
|
|
|
|
##############
|
|
|
|
.PHONY: install-changelog
|
|
|
|
|
|
|
|
install-changelog:
|
|
|
|
go install ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION}
|