Skip to content

Commit df69283

Browse files
authored
Switch to Changie for changelog automation (#222)
1 parent fe1f1c7 commit df69283

File tree

6 files changed

+190
-12
lines changed

6 files changed

+190
-12
lines changed

.changes/0.13.0.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# 0.13.0 (July 8, 2022)
2+
3+
ENHANCEMENTS:
4+
5+
* schemamd: Nested attributes are now correctly grouped in "optional", "required" and "read-only" ([#163](https://github.com/hashicorp/terraform-plugin-docs/pull/163)).
6+
7+
BUG FIXES:
8+
9+
* template functions: `title` now capitalizes each word in the input string, instead of upper-casing them ([#165](https://github.com/hashicorp/terraform-plugin-docs/pull/165)).
10+
11+
# 0.12.0 (June 29, 2022)
12+
13+
BUG FIXES:
14+
15+
* template data: A regression was introduced in [#155](https://github.com/hashicorp/terraform-plugin-docs/pull/155) making template data field `HasExample` and `HasImport` always true ([#162](https://github.com/hashicorp/terraform-plugin-docs/pull/162)).
16+
17+
NEW FEATURES:
18+
19+
* template functions: Added `lower`, `upper` and `title` ([#162](https://github.com/hashicorp/terraform-plugin-docs/pull/162)).
20+
21+
ENHANCEMENTS:
22+
23+
* Added documentation for all the template functions and template data fields ([#162](https://github.com/hashicorp/terraform-plugin-docs/pull/162)).
24+
25+
# 0.11.0 (June 28, 2022)
26+
27+
NEW FEATURES:
28+
29+
* cmd/tfplugindocs: Additional CLI argument `ignore-deprecated` allows to skip deprecated resources and data-sources when generating docs ([#154](https://github.com/hashicorp/terraform-plugin-docs/pull/154)).
30+
31+
BUG FIXES:
32+
33+
* cmd/tfplugindocs: Pass through filepaths for `examples` and `import` to allow use of `HasExample` and `HasImport` template helpers in custom templates ([#155](https://github.com/hashicorp/terraform-plugin-docs/pull/155)).
34+
* cmd/tfplugindocs: Fixed issue with the generation of title and reference links, when nested attributes go too deep ([#56](https://github.com/hashicorp/terraform-plugin-docs/pull/56)).
35+
36+
# 0.10.1 (June 14, 2022)
37+
38+
BUG FIXES:
39+
40+
* cmd/tfplugindocs: Do not error when schema not found, issue log warning ([#151](https://github.com/hashicorp/terraform-plugin-docs/pull/151)).
41+
42+
# 0.10.0 (June 13, 2022)
43+
44+
BUG FIXES:
45+
46+
* cmd/tfplugindocs: Allow single word resources to use templates ([#147](https://github.com/hashicorp/terraform-plugin-docs/pull/147)).
47+
* cmd/tfplugindocs: Pass in correct provider name for data-source and resource schema lookup when overidden with `rendered-provider-name` flag ([#148](https://github.com/hashicorp/terraform-plugin-docs/pull/148)).
48+
49+
ENHANCEMENTS:
50+
51+
* cmd/tfplugindocs: Expose `RenderedProviderName` to templates ([#149](https://github.com/hashicorp/terraform-plugin-docs/pull/149)).
52+
53+
# 0.9.0 (June 1, 2022)
54+
55+
NEW FEATURES:
56+
57+
* cmd/tfplugindocs: Additional CLI arguments `provider-name`, `rendered-provider-name`, `rendered-website-dir`, `examples-dir`, `website-temp-dir`, and `website-source-dir`. These allow to further customise generated doc ([#95](https://github.com/hashicorp/terraform-plugin-docs/pull/95)).
58+
59+
ENHANCEMENTS:
60+
61+
* cmd/tfplugindocs: Implemented usage output (i.e. `--help`) for `generate` and `validate` commands ([#95](https://github.com/hashicorp/terraform-plugin-docs/pull/95)).
62+
63+
# 0.8.1 (May 10, 2022)
64+
65+
BUG FIXES:
66+
67+
* cmd/tfplugindocs: Updated version of [hc-install](github.com/hashicorp/hc-install) in response to change in HashiCorp Release API [sending back a different `Content-Type` header](https://github.com/hashicorp/hc-install/issues/56). This was causing failures when the tool attempted to install Terraform. ([#135](https://github.com/hashicorp/terraform-plugin-docs/issues/135))
68+
69+
# 0.8.0 (May 3, 2022)
70+
71+
ENHANCEMENTS:
72+
73+
* template functions: Added `split` to help separating a string into substrings ([#70](https://github.com/hashicorp/terraform-plugin-docs/pull/70)).
74+
75+
BUG FIXES:
76+
77+
* cmd/tflugindocs: Support for schemas containing empty nested attributes or empty nested blocks ([#99](https://github.com/hashicorp/terraform-plugin-docs/pull/99), [#134](https://github.com/hashicorp/terraform-plugin-docs/pull/134)).
78+
* schemamd: Attribute `ID` is considered "Read Only", unless there's a description defined, in which case it's handled like any other attribute in the schema ([#46](https://github.com/hashicorp/terraform-plugin-docs/pull/46), [#134](https://github.com/hashicorp/terraform-plugin-docs/pull/134)).
79+
80+
# 0.7.0 (March 15, 2022)
81+
82+
ENHANCEMENTS:
83+
84+
* cmd/tfplugindocs: Use existing Terraform CLI binary if available on PATH, otherwise download latest Terraform CLI binary ([#124](https://github.com/hashicorp/terraform-plugin-docs/pull/124)).
85+
* cmd/tfplugindocs: Added `tf-version` flag for specifying Terraform CLI binary version to download, superseding the PATH lookup ([#124](https://github.com/hashicorp/terraform-plugin-docs/pull/124)).
86+
87+
BUG FIXES:
88+
89+
* cmd/tfplugindocs: Swapped `.Type` and `.Name` resource and data source template fields so they correctly align ([#44](https://github.com/hashicorp/terraform-plugin-docs/pull/44)).
90+
* schemamd: Switched attribute name rendering from bold text to code blocks so the Terraform Registry treats them as anchor links ([#59](https://github.com/hashicorp/terraform-plugin-docs/pull/59)).
91+
92+
# 0.6.0 (March 14, 2022)
93+
94+
NOTES:
95+
96+
* dependencies: `github.com/hashicorp/terraform-exec` dependency has been updated to match `terraform-plugin-sdk`, which replaced the removed `tfinstall` package with `github.com/hashicorp/hc-install`. This will resolve Go build errors for projects that import both `terraform-plugin-docs` and `terraform-plugin-sdk`.

.changes/unreleased/.gitkeep

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: NOTES
2+
body: This Go module has been updated to Go 1.18 per the [Go support policy](https://go.dev/doc/devel/release#policy).
3+
Any consumers building on earlier Go versions may experience errors
4+
time: 2023-02-09T17:47:59.646473-05:00
5+
custom:
6+
Issue: "199"

.changie.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
changesDir: .changes
2+
unreleasedDir: unreleased
3+
changelogPath: CHANGELOG.md
4+
versionExt: md
5+
versionFormat: '## {{.Version}} ({{.Time.Format "January 02, 2006"}})'
6+
kindFormat: '{{.Kind}}:'
7+
changeFormat: '* {{.Body}} ([#{{.Custom.Issue}}](https://github.com/hashicorp/terraform-plugin-docs/issues/{{.Custom.Issue}}))'
8+
custom:
9+
- key: Issue
10+
label: Issue/PR Number
11+
type: int
12+
minInt: 1
13+
kinds:
14+
- label: BREAKING CHANGES
15+
- label: NOTES
16+
- label: FEATURES
17+
- label: ENHANCEMENTS
18+
- label: BUG FIXES
19+
newlines:
20+
afterKind: 1
21+
beforeKind: 1
22+
endOfVersion: 2

.github/workflows/release.yml

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: release
22

33
on:
4-
push:
5-
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+*'
4+
workflow_dispatch:
5+
inputs:
6+
versionNumber:
7+
description: 'Release version number (v#.#.#)'
8+
type: string
9+
required: true
10+
11+
env:
12+
CI_COMMIT_AUTHOR: hc-github-team-tf-provider-devex
13+
CI_COMMIT_EMAIL: [email protected]
714

815
permissions:
916
# Allow creating GitHub release
@@ -12,19 +19,72 @@ permissions:
1219
issues: write
1320

1421
jobs:
22+
changelog-version:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
version: ${{ steps.changelog-version.outputs.version }}
26+
steps:
27+
- id: changelog-version
28+
run: echo "version=$(echo "${{ inputs.versionNumber }}" | cut -c 2-)" >> "$GITHUB_OUTPUT"
29+
changelog:
30+
needs: changelog-version
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
35+
with:
36+
fetch-depth: 0
37+
- name: Batch changes
38+
uses: miniscruff/changie-action@b6d52c80deb236a5b548f8774cd5a18b87da9e9a # v1.0.1
39+
with:
40+
version: latest
41+
args: batch ${{ needs.changelog-version.outputs.version }}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Merge changes
45+
uses: miniscruff/changie-action@b6d52c80deb236a5b548f8774cd5a18b87da9e9a # v1.0.1
46+
with:
47+
version: latest
48+
args: merge
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
- name: Git push changelog
52+
run: |
53+
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
54+
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
55+
git add .
56+
git commit -a -m "Update changelog"
57+
git push
58+
release-tag:
59+
needs: changelog
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
64+
with:
65+
fetch-depth: 0
66+
- name: Git push release tag
67+
run: |
68+
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
69+
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
70+
git pull
71+
git tag "${{ inputs.versionNumber }}"
72+
git push origin "${{ inputs.versionNumber }}"
1573
goreleaser:
74+
needs: [ changelog-version, changelog, release-tag ]
1675
runs-on: ubuntu-latest
1776
steps:
1877
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
1978
with:
20-
# Required for release notes
79+
ref: ${{ inputs.versionNumber }}
2180
fetch-depth: 0
2281
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
2382
with:
2483
go-version-file: 'go.mod'
2584
- name: Generate Release Notes
26-
# Fetch CHANGELOG.md contents up to Git tag prior to this release, skipping top two lines
27-
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > /tmp/release-notes.txt
85+
run: |
86+
cd .changes
87+
sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt
2888
- uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
2989
env:
3090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# 0.14.0 (unreleased)
2-
3-
NOTES:
4-
5-
* This Go module has been updated to Go 1.18 per the [Go support policy](https://go.dev/doc/devel/release#policy). Any consumers building on earlier Go versions may experience errors ([#199](https://github.com/hashicorp/terraform-plugin-docs/pull/199)).
6-
71
# 0.13.0 (July 8, 2022)
82

93
ENHANCEMENTS:

0 commit comments

Comments
 (0)