diff --git a/.changes/unreleased/.gitkeep b/.changes/unreleased/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.changes/v1.0.0-rc.1.md b/.changes/v1.0.0-rc.1.md new file mode 100644 index 0000000..a615859 --- /dev/null +++ b/.changes/v1.0.0-rc.1.md @@ -0,0 +1,11 @@ +## v1.0.0-rc.1 (2023-02-13) + +### Bug Fixes + +- **github-actions:** rename repository secret variable GITHUB_TOKEN to GH_TOKEN + +### Documentations + +- update README.md + +Full Changelog: [v1.0.0-rc.1](https://github.com/ansidev/sample-gitflow-release-workflows/commits/v1.0.0-rc.1) diff --git a/.changes/v1.0.1-rc.0.md b/.changes/v1.0.1-rc.0.md new file mode 100644 index 0000000..4234314 --- /dev/null +++ b/.changes/v1.0.1-rc.0.md @@ -0,0 +1,15 @@ +## [v1.0.1-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.0-rc.1...v1.0.1-rc.0) (2023-02-13) + +### Bug Fixes + +- **github-actions:** rename repository secret variable GITHUB_TOKEN to GH_TOKEN + +### Documentations + +- update README.md + +### Features + +- **github-actions:** update workflow using GitHub CLI + +Full Changelog: [v1.0.0-rc.1...v1.0.1-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.0-rc.1...v1.0.1-rc.0) diff --git a/.changes/v1.0.1-rc.1.md b/.changes/v1.0.1-rc.1.md new file mode 100644 index 0000000..73b2ca5 --- /dev/null +++ b/.changes/v1.0.1-rc.1.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.0...v1.0.1-rc.1) (2023-02-13) + +### Bug Fixes + +- **github-actions:** correct syntax + +Full Changelog: [v1.0.1-rc.0...v1.0.1-rc.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.0...v1.0.1-rc.1) diff --git a/.changes/v1.0.1-rc.2.md b/.changes/v1.0.1-rc.2.md new file mode 100644 index 0000000..3926400 --- /dev/null +++ b/.changes/v1.0.1-rc.2.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.1...v1.0.1-rc.2) (2023-02-13) + +### Bug Fixes + +- **github-actions:** add missing checkout step + +Full Changelog: [v1.0.1-rc.1...v1.0.1-rc.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.1...v1.0.1-rc.2) diff --git a/.changes/v1.0.1-rc.3.md b/.changes/v1.0.1-rc.3.md new file mode 100644 index 0000000..9d8ab67 --- /dev/null +++ b/.changes/v1.0.1-rc.3.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.3](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.2...v1.0.1-rc.3) (2023-02-13) + +### Bug Fixes + +- **github-actions:** remove invalid command flag + +Full Changelog: [v1.0.1-rc.2...v1.0.1-rc.3](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.2...v1.0.1-rc.3) diff --git a/.changes/v1.0.1-rc.4.md b/.changes/v1.0.1-rc.4.md new file mode 100644 index 0000000..cf76af1 --- /dev/null +++ b/.changes/v1.0.1-rc.4.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.4](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.3...v1.0.1-rc.4) (2023-02-13) + +### Bug Fixes + +- **github-actions:** fix fail steps and refactor code + +Full Changelog: [v1.0.1-rc.3...v1.0.1-rc.4](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.3...v1.0.1-rc.4) diff --git a/.changes/v1.0.1-rc.5.md b/.changes/v1.0.1-rc.5.md new file mode 100644 index 0000000..49d6e48 --- /dev/null +++ b/.changes/v1.0.1-rc.5.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.5](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.4...v1.0.1-rc.5) (2023-02-13) + +### Bug Fixes + +- **github-actions:** revert wrong changes + +Full Changelog: [v1.0.1-rc.4...v1.0.1-rc.5](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.4...v1.0.1-rc.5) diff --git a/.changes/v1.0.1-rc.6.md b/.changes/v1.0.1-rc.6.md new file mode 100644 index 0000000..b0dcb03 --- /dev/null +++ b/.changes/v1.0.1-rc.6.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.6](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.5...v1.0.1-rc.6) (2023-02-13) + +### Bug Fixes + +- **github-actions:** correct command flag value + +Full Changelog: [v1.0.1-rc.5...v1.0.1-rc.6](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.5...v1.0.1-rc.6) diff --git a/.changes/v1.0.1-rc.7.md b/.changes/v1.0.1-rc.7.md new file mode 100644 index 0000000..515f769 --- /dev/null +++ b/.changes/v1.0.1-rc.7.md @@ -0,0 +1,7 @@ +## [v1.0.1-rc.7](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.6...v1.0.1-rc.7) (2023-02-13) + +### Bug Fixes + +- **github-actions:** fix failed command gh pr create + +Full Changelog: [v1.0.1-rc.6...v1.0.1-rc.7](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.6...v1.0.1-rc.7) diff --git a/.changes/v1.0.2-rc.0.md b/.changes/v1.0.2-rc.0.md new file mode 100644 index 0000000..851bc31 --- /dev/null +++ b/.changes/v1.0.2-rc.0.md @@ -0,0 +1,11 @@ +## [v1.0.2-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.7...v1.0.2-rc.0) (2023-02-13) + +### Features + +- **workflow-release:** auto create merge commit for PR on merging + +- **workflow-release:** auto merge PR after creating ([#18](https://github.com/ansidev/sample-gitflow-release-workflows/issues/18)) + +- **workflow-release:** auto merge PR after creating + +Full Changelog: [v1.0.1-rc.7...v1.0.2-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.7...v1.0.2-rc.0) diff --git a/.changes/v1.0.2.md b/.changes/v1.0.2.md new file mode 100644 index 0000000..f5cc93b --- /dev/null +++ b/.changes/v1.0.2.md @@ -0,0 +1,11 @@ +## [v1.0.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.2-rc.0...v1.0.2) (2023-02-13) + +### Bug Fixes + +- **github-actions:** fix PR body + +### Documentations + +- update README.md + +Full Changelog: [v1.0.2-rc.0...v1.0.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.2-rc.0...v1.0.2) diff --git a/.changes/v1.1.0-rc.0.md b/.changes/v1.1.0-rc.0.md new file mode 100644 index 0000000..639ed72 --- /dev/null +++ b/.changes/v1.1.0-rc.0.md @@ -0,0 +1,17 @@ +## [v1.1.0-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.2...v1.1.0-rc.0) (2023-02-14) + +### Bug Fixes + +- **workflow-draft_release_hotfix_pr:** ignore creating PR if it exists, add custom PR description + +- **workflow-draft_release_hotfix_pr:** correct syntax + +### Documentations + +- update README.md + +### Features + +- **workflow-draft-release-hotfix-pr:** add new workflow for auto creating draft pr on pushing release or hotfix branch + +Full Changelog: [v1.0.2...v1.1.0-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.2...v1.1.0-rc.0) diff --git a/.changes/v1.1.0-rc.1.md b/.changes/v1.1.0-rc.1.md new file mode 100644 index 0000000..22a31d6 --- /dev/null +++ b/.changes/v1.1.0-rc.1.md @@ -0,0 +1,19 @@ +## [v1.1.0-rc.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.0...v1.1.0-rc.1) (2023-02-14) + +### Bug Fixes + +- **workflow-draft-release-hotfix-pr:** fix PR is missing label `pre-release` + +- **workflow-draft-release-hotfix-pr:** correct wrong logic + +### Documentations + +- update README.md + +### Features + +- **workflow-auto-merge-release-hotfix-into-develop:** add new workflow for auto merging release/hotfix into develop ([#26](https://github.com/ansidev/sample-gitflow-release-workflows/issues/26)) + +- **workflow-auto-merge-release-hotfix-into-develop:** add new workflow for auto merging release/hotfix into develop + +Full Changelog: [v1.1.0-rc.0...v1.1.0-rc.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.0...v1.1.0-rc.1) diff --git a/.changes/v1.1.0-rc.2.md b/.changes/v1.1.0-rc.2.md new file mode 100644 index 0000000..f6743fb --- /dev/null +++ b/.changes/v1.1.0-rc.2.md @@ -0,0 +1,13 @@ +## [v1.1.0-rc.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.1...v1.1.0-rc.2) (2023-02-14) + +### Bug Fixes + +- **workflow-auto-merge-release-hotfix-into-develop:** set environment variable `GH_TOKEN` + +- **workflow-draft-release-hotfix-pr:** fix PR is missing label `pre-release` + +### Documentations + +- **readme:** add reference documentations + +Full Changelog: [v1.1.0-rc.1...v1.1.0-rc.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.1...v1.1.0-rc.2) diff --git a/.changes/v1.1.0-rc.3.md b/.changes/v1.1.0-rc.3.md new file mode 100644 index 0000000..685c050 --- /dev/null +++ b/.changes/v1.1.0-rc.3.md @@ -0,0 +1,7 @@ +## [v1.1.0-rc.3](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.2...v1.1.0-rc.3) (2023-02-14) + +### Bug Fixes + +- **workflow-auto-merge-release-hotfix-into-develop:** add missing step checkout repository + +Full Changelog: [v1.1.0-rc.2...v1.1.0-rc.3](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.2...v1.1.0-rc.3) diff --git a/.changes/v1.1.0.md b/.changes/v1.1.0.md new file mode 100644 index 0000000..040fae8 --- /dev/null +++ b/.changes/v1.1.0.md @@ -0,0 +1,3 @@ +## [v1.1.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.3...v1.1.0) (2023-02-14) + +Full Changelog: [v1.1.0-rc.3...v1.1.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0-rc.3...v1.1.0) diff --git a/.changes/v1.1.1-rc.0.md b/.changes/v1.1.1-rc.0.md new file mode 100644 index 0000000..cebbcf3 --- /dev/null +++ b/.changes/v1.1.1-rc.0.md @@ -0,0 +1,9 @@ +## [v1.1.1-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0...v1.1.1-rc.0) (2023-02-14) + +### Bug Fixes + +- **workflow-draft-release-hotfix-pr:** correct bash syntax + +- **workflow-release:** set the release as pre-release depending on the version + +Full Changelog: [v1.1.0...v1.1.1-rc.0](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.0...v1.1.1-rc.0) diff --git a/.changes/v1.1.1.md b/.changes/v1.1.1.md new file mode 100644 index 0000000..e81296b --- /dev/null +++ b/.changes/v1.1.1.md @@ -0,0 +1,3 @@ +## [v1.1.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.1-rc.0...v1.1.1) (2023-02-14) + +Full Changelog: [v1.1.1-rc.0...v1.1.1](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.1-rc.0...v1.1.1) diff --git a/.changes/v1.1.2.md b/.changes/v1.1.2.md new file mode 100644 index 0000000..5485cab --- /dev/null +++ b/.changes/v1.1.2.md @@ -0,0 +1,11 @@ +## [v1.1.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.1...v1.1.2) (2023-02-15) + +### Documentations + +- **changelog:** change format of CHANGELOG.md + +### Features + +- **dev-tool:** add git-chglog config + +Full Changelog: [v1.1.1...v1.1.2](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.1.1...v1.1.2) diff --git a/.changie.yaml b/.changie.yaml new file mode 100644 index 0000000..4d049cb --- /dev/null +++ b/.changie.yaml @@ -0,0 +1,13 @@ +changesDir: .changes +unreleasedDir: unreleased +headerPath: ../.chglog/CHANGELOG_HEADER.tpl.md +changelogPath: CHANGELOG.md +versionExt: md +newlines: + afterChangelogHeader: 0 + beforeChangelogVersion: 1 + endOfVersion: 1 +replacements: + - path: "VERSION" + find: ".*" + replace: "{{.VersionNoPrefix}}" diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 0227b3e..9b23422 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -1,11 +1,5 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). - -{{ range .Versions }} -## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) +{{ range .Versions -}} +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) {{ range .CommitGroups }} ### {{ .Title }} {{ range .Commits }} @@ -22,12 +16,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a {{ end -}} {{ end }} Full Changelog: {{ if .Tag.Previous }}[{{ .Tag.Previous.Name }}...{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/commits/{{ .Tag.Name }}){{ end }} -{{ end }} - -{{- if .Versions }} -{{ 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/CHANGELOG_HEADER.tpl.md b/.chglog/CHANGELOG_HEADER.tpl.md new file mode 100644 index 0000000..537ab21 --- /dev/null +++ b/.chglog/CHANGELOG_HEADER.tpl.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). diff --git a/.gitignore b/.gitignore index d7bb2d6..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -Taskfile.yaml diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..4012ebb --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,66 @@ +# https://taskfile.dev + +version: "3" + +env: + TAG_PREFIX: v + CHANGES_DIR: .changes + +tasks: + prepare: + desc: Install tools + cmds: + - go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest + - go install github.com/miniscruff/changie@latest + + batch-changelog: + desc: Generate changelog for existing git tags + cmds: + - rm ${CHANGES_DIR}/${TAG_PREFIX}*.md || true + - for VERSION_TAG in $(git -c 'versionsort.suffix=-' tag --list --sort=v:refname); do git-chglog --output ${CHANGES_DIR}/${VERSION_TAG}.md ${VERSION_TAG} ; done + silent: true + + changelog: + desc: Generate changelog for an existing version + vars: + VERSION_TAG: ${TAG_PREFIX}{{.CLI_ARGS}} + cmds: + - git-chglog --output ${CHANGES_DIR}/{{.VERSION_TAG}}.md {{.VERSION_TAG}} + silent: true + + changelog-next: + desc: Generate changelog for a new version + vars: + VERSION_TAG: ${TAG_PREFIX}{{.CLI_ARGS}} + cmds: + - git-chglog --output ${CHANGES_DIR}/{{.VERSION_TAG}}.md --next-tag {{.VERSION_TAG}} + silent: true + + bump-version: + desc: Bump version + cmds: + - echo {{.CLI_ARGS}} > VERSION + silent: true + + commit-release: + desc: Create release commit + vars: + VERSION_TAG: ${TAG_PREFIX}{{.CLI_ARGS}} + cmds: + - git add ${CHANGES_DIR} + - git add CHANGELOG.md + - git add VERSION + - | + git commit -m "chore(release): {{.VERSION_TAG}}" + silent: true + + release: + desc: Generate release commit + vars: + VERSION_TAG: ${TAG_PREFIX}{{.CLI_ARGS}} + cmds: + - echo "Releasing version {{.VERSION_TAG}}" + - task changelog-next -- {{.CLI_ARGS}} + - task bump-version -- {{.CLI_ARGS}} + - task commit-release -- {{.CLI_ARGS}} + silent: true