diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100755 index 00000000..5683d039 --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,56 @@ +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts +{{ range .RevertCommits -}} +- {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 00000000..c268d5e0 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,28 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/aws-games/cloud-game-development-toolkit +options: + commits: + # filters: + # Type: + # - feat + # - fix + # - perf + # - refactor + commit_groups: + # title_maps: + # feat: Features + # fix: Bug Fixes + # perf: Performance Improvements + # refactor: Code Refactoring + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + notes: + keywords: + - BREAKING CHANGE \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 12fea0e8..5cda58cb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ on: workflow_dispatch: inputs: version: - description: "Version to build and publish docs (i.e. 0.1.0-alpha.1, latest)" + description: "Version to build and publish docs (i.e. v0.1.0-alpha.1, v1.0.0)" required: true type: string alias: @@ -56,7 +56,7 @@ jobs: echo "VERSION is: ${{ inputs.version }}" echo "ALIAS is: ${{ inputs.alias }}" - name: Build docs - run: make docs-build VERSION=$RELEASE_VERSION + run: make docs-build VERSION="$VERSION" - name: Deploy Docs - run: make docs-deploy VERSION="$RELEASE_VERSION" ALIAS="$ALIAS" + run: make docs-deploy VERSION="$VERSION" ALIAS="$ALIAS" diff --git a/Makefile b/Makefile index 5dddb0c1..78d1d136 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,5 @@ -.PHONY: help docs-build docs-local-docker docs-deploy - .DEFAULT_GOAL := help -########################################################### -# ENVIRONMENT VARIABLES -########################################################### ifeq ($(GITHUB_ACTIONS),true) GIT_USER_NAME := github-actions[bot] GIT_USER_EMAIL := "41898282+github-actions[bot]@users.noreply.github.com" @@ -13,10 +8,6 @@ else GIT_USER_EMAIL := $(shell git config user.email) endif -########################################################### -# COLOR CONFIGURATION -# Check if the terminal supports color, define color codes -########################################################### COLOR_SUPPORT := $(shell tput colors 2>/dev/null) # Define color codes if the terminal supports color ifdef COLOR_SUPPORT @@ -28,35 +19,33 @@ ifdef COLOR_SUPPORT endif endif -########################################################### -# docs-build -########################################################### + +.PHONY: docs-build docs-build: ## Build the docs using docker. Example: `make docs-build VERSION=1.0.0` @if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi @echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}" - docker build -f ./docs/Dockerfile -t docs:$(VERSION) . --build-arg GIT_USER_NAME="$(GIT_USER_NAME)" --build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" --build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) --no-cache + docker build -f ./docs/Dockerfile -t docs:$(VERSION) . \ + --build-arg GIT_USER_NAME="$(GIT_USER_NAME)" \ + --build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" \ + --build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) \ + --no-cache -########################################################### -# docs-deploy -########################################################### +.PHONY: docs-deploy docs-deploy: ## Deploy the docs using 'mike'. Example: `make docs-deploy VERSION=1.0.0 ALIAS=latest` @if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi @if [ -z "${ALIAS}" ]; then echo -e "${RED}ALIAS is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi @echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}" docker run -t docs:$(VERSION) mike deploy --push --update-aliases $(VERSION) ${ALIAS} -########################################################### -# docs-local-docker -########################################################### + +.PHONY: docs-local docs-local-docker: ## Build and run the docs locally using docker and 'serve'. Example: `make docs-local-docker VERSION=1.0.0` @if [ -z "${VERSION}" ]; then echo -e "${RED}VERSION is not set. Run 'make help' for usage. ${RESET}"; exit 1; fi @echo -e "Docs version is: ${GREEN}$(VERSION)${RESET}" docker build -f ./docs/Dockerfile -t docs:$(VERSION) . --build-arg GIT_USER_NAME="$(GIT_USER_NAME)" --build-arg GIT_USER_EMAIL="$(GIT_USER_EMAIL)" --build-arg GITHUB_ACTIONS=$(GITHUB_ACTIONS) --no-cache docker run -t docs:$(VERSION) mike deploy --push --update-aliases $(VERSION) latest -########################################################### -# help -########################################################### +.PHONY: help help: ## Display this help @echo -e "Usage: make [TARGET]\n" @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "${CYAN}%-30s${RESET} %s\n", $$1, $$2}'