Skip to content

Commit

Permalink
Switch to Changie for changelog automation (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
SBGoods authored Feb 10, 2023
1 parent fe1f1c7 commit df69283
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 12 deletions.
96 changes: 96 additions & 0 deletions .changes/0.13.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 0.13.0 (July 8, 2022)

ENHANCEMENTS:

* schemamd: Nested attributes are now correctly grouped in "optional", "required" and "read-only" ([#163](https://github.com/hashicorp/terraform-plugin-docs/pull/163)).

BUG FIXES:

* 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)).

# 0.12.0 (June 29, 2022)

BUG FIXES:

* 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)).

NEW FEATURES:

* template functions: Added `lower`, `upper` and `title` ([#162](https://github.com/hashicorp/terraform-plugin-docs/pull/162)).

ENHANCEMENTS:

* Added documentation for all the template functions and template data fields ([#162](https://github.com/hashicorp/terraform-plugin-docs/pull/162)).

# 0.11.0 (June 28, 2022)

NEW FEATURES:

* 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)).

BUG FIXES:

* 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)).
* 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)).

# 0.10.1 (June 14, 2022)

BUG FIXES:

* cmd/tfplugindocs: Do not error when schema not found, issue log warning ([#151](https://github.com/hashicorp/terraform-plugin-docs/pull/151)).

# 0.10.0 (June 13, 2022)

BUG FIXES:

* cmd/tfplugindocs: Allow single word resources to use templates ([#147](https://github.com/hashicorp/terraform-plugin-docs/pull/147)).
* 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)).

ENHANCEMENTS:

* cmd/tfplugindocs: Expose `RenderedProviderName` to templates ([#149](https://github.com/hashicorp/terraform-plugin-docs/pull/149)).

# 0.9.0 (June 1, 2022)

NEW FEATURES:

* 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)).

ENHANCEMENTS:

* cmd/tfplugindocs: Implemented usage output (i.e. `--help`) for `generate` and `validate` commands ([#95](https://github.com/hashicorp/terraform-plugin-docs/pull/95)).

# 0.8.1 (May 10, 2022)

BUG FIXES:

* 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))

# 0.8.0 (May 3, 2022)

ENHANCEMENTS:

* template functions: Added `split` to help separating a string into substrings ([#70](https://github.com/hashicorp/terraform-plugin-docs/pull/70)).

BUG FIXES:

* 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)).
* 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)).

# 0.7.0 (March 15, 2022)

ENHANCEMENTS:

* 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)).
* 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)).

BUG FIXES:

* 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)).
* 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)).

# 0.6.0 (March 14, 2022)

NOTES:

* 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`.
Empty file added .changes/unreleased/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions .changes/unreleased/NOTES-20230209-174759.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: NOTES
body: 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
time: 2023-02-09T17:47:59.646473-05:00
custom:
Issue: "199"
22 changes: 22 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
changesDir: .changes
unreleasedDir: unreleased
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} ({{.Time.Format "January 02, 2006"}})'
kindFormat: '{{.Kind}}:'
changeFormat: '* {{.Body}} ([#{{.Custom.Issue}}](https://github.com/hashicorp/terraform-plugin-docs/issues/{{.Custom.Issue}}))'
custom:
- key: Issue
label: Issue/PR Number
type: int
minInt: 1
kinds:
- label: BREAKING CHANGES
- label: NOTES
- label: FEATURES
- label: ENHANCEMENTS
- label: BUG FIXES
newlines:
afterKind: 1
beforeKind: 1
endOfVersion: 2
72 changes: 66 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
versionNumber:
description: 'Release version number (v#.#.#)'
type: string
required: true

env:
CI_COMMIT_AUTHOR: hc-github-team-tf-provider-devex
CI_COMMIT_EMAIL: github-team-tf-provider-devex@hashicorp.com

permissions:
# Allow creating GitHub release
Expand All @@ -12,19 +19,72 @@ permissions:
issues: write

jobs:
changelog-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog-version.outputs.version }}
steps:
- id: changelog-version
run: echo "version=$(echo "${{ inputs.versionNumber }}" | cut -c 2-)" >> "$GITHUB_OUTPUT"
changelog:
needs: changelog-version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Batch changes
uses: miniscruff/changie-action@b6d52c80deb236a5b548f8774cd5a18b87da9e9a # v1.0.1
with:
version: latest
args: batch ${{ needs.changelog-version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge changes
uses: miniscruff/changie-action@b6d52c80deb236a5b548f8774cd5a18b87da9e9a # v1.0.1
with:
version: latest
args: merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git push changelog
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git add .
git commit -a -m "Update changelog"
git push
release-tag:
needs: changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
- name: Git push release tag
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git pull
git tag "${{ inputs.versionNumber }}"
git push origin "${{ inputs.versionNumber }}"
goreleaser:
needs: [ changelog-version, changelog, release-tag ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
# Required for release notes
ref: ${{ inputs.versionNumber }}
fetch-depth: 0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version-file: 'go.mod'
- name: Generate Release Notes
# Fetch CHANGELOG.md contents up to Git tag prior to this release, skipping top two lines
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
run: |
cd .changes
sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt
- uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# 0.14.0 (unreleased)

NOTES:

* 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)).

# 0.13.0 (July 8, 2022)

ENHANCEMENTS:
Expand Down

0 comments on commit df69283

Please sign in to comment.