Skip to content

Commit f709c7a

Browse files
authored
Merge pull request #187 from hashicorp/changie-automation
Add Changie changelog automation
2 parents fa42753 + a3a9feb commit f709c7a

File tree

5 files changed

+207
-13
lines changed

5 files changed

+207
-13
lines changed

.changes/2.3.0.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## 2.3.0 (January 18, 2023)
2+
3+
NOTES:
4+
5+
* Provider has been re-written using the new [`terraform-plugin-framework`](https://www.terraform.io/plugin/framework) ([#170](https://github.com/hashicorp/terraform-provider-archive/pull/170)).
6+
7+
## 2.2.0 (May 04, 2021)
8+
9+
ENHANCEMENTS:
10+
11+
* New opt-in flag to specify the `output_file_mode` to produce more deterministic behavior across operating systems. ([#90](https://github.com/terraform-providers/terraform-provider-archive/issues/90))
12+
13+
DEPENDENCIES:
14+
15+
* Update `github.com/hashicorp/terraform-plugin-sdk/v2` to `v2.6.1` ([#95](https://github.com/terraform-providers/terraform-provider-archive/issues/95))
16+
17+
NOTES:
18+
19+
Changelogs now list all dependency updates in a separate section. These are understood to have no user-facing changes except those detailed in earlier sections.
20+
21+
## 2.1.0 (February 19, 2021)
22+
23+
Binary releases of this provider now include the darwin-arm64 platform. This version contains no further changes.
24+
25+
## 2.0.0 (October 14, 2020)
26+
27+
Binary releases of this provider now include the linux-arm64 platform.
28+
29+
BREAKING CHANGES:
30+
31+
* Upgrade to version 2 of the Terraform Plugin SDK, which drops support for Terraform 0.11. This provider will continue to work as expected for users of Terraform 0.11, which will not download the new version. ([#72](https://github.com/terraform-providers/terraform-provider-archive/issues/72))
32+
33+
BUG FIXES:
34+
35+
* Fixed path bug with exclusions on Windows ([#71](https://github.com/terraform-providers/terraform-provider-archive/issues/71))
36+
37+
## 1.3.0 (September 30, 2019)
38+
39+
NOTES:
40+
41+
* The provider has switched to the standalone TF SDK, there should be no noticeable impact on compatibility. ([#50](https://github.com/terraform-providers/terraform-provider-archive/issues/50))
42+
43+
## 1.2.2 (April 30, 2019)
44+
45+
* This release includes another Terraform SDK upgrade intended to align with that being used for other providers as we prepare for the Core v0.12.0 release. It should have no significant changes in behavior for this provider.
46+
47+
## 1.2.1 (April 12, 2019)
48+
49+
* This release includes only a Terraform SDK upgrade intended to align with that being used for other providers as we prepare for the Core v0.12.0 release. It should have no significant changes in behavior for this provider.
50+
51+
## 1.2.0 (March 20, 2019)
52+
53+
IMPROVEMENTS:
54+
55+
* The provider is now compatible with Terraform v0.12, while retaining compatibility with prior versions.
56+
57+
## 1.1.0 (July 30, 2018)
58+
59+
ENHANCEMENTS:
60+
61+
* Add `excludes` to the `archive_file` data source to exclude files when using `source_dir` ([#18](https://github.com/terraform-providers/terraform-provider-archive/issues/18))
62+
63+
BUG FIXES:
64+
65+
* Fix zip file path names to use forward slash on Windows ([#25](https://github.com/terraform-providers/terraform-provider-archive/issues/25))
66+
* Fix panic in `filepath.Walk` call ([#26](https://github.com/terraform-providers/terraform-provider-archive/issues/26))
67+
68+
## 1.0.3 (March 23, 2018)
69+
70+
BUG FIXES:
71+
72+
* Fix modified time affecting zip contents and causing spurious diffs ([#16](https://github.com/terraform-providers/terraform-provider-archive/issues/16))
73+
74+
## 1.0.2 (March 16, 2018)
75+
76+
BUG FIXES:
77+
78+
* Fix issue with flags not being copied on a single file and regression introduced in 1.0.1 ([#13](https://github.com/terraform-providers/terraform-provider-archive/issues/13))
79+
80+
## 1.0.1 (March 13, 2018)
81+
82+
BUG FIXES:
83+
84+
* Fix issue with flags not being copied in to archive ([#9](https://github.com/terraform-providers/terraform-provider-archive/issues/9))
85+
86+
## 1.0.0 (September 15, 2017)
87+
88+
* No changes from 0.1.0; just adjusting to [the new version numbering scheme](https://www.hashicorp.com/blog/hashicorp-terraform-provider-versioning/).
89+
90+
## 0.1.0 (June 20, 2017)
91+
92+
NOTES:
93+
94+
* Same functionality as that of Terraform 0.9.8. Repacked as part of [Provider Splitout](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/)

.changes/unreleased/.gitkeep

Whitespace-only changes.

.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-provider-archive/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/CONTRIBUTING.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,30 @@ and to gauge the risk of an upgrade.
9393
We follow Terraform Plugin
9494
[changelog specifications](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#changelog-specification).
9595

96+
#### Changie Automation Tool
97+
This project uses the [Changie](https://changie.dev/) automation tool for changelog automation.
98+
99+
To add a new entry to the `CHANGELOG`, install Changie using the following [instructions](https://changie.dev/guide/installation/)
100+
101+
After Changie is installed on your local machine, run:
102+
```bash
103+
changie new
104+
```
105+
and choose a `kind` of change corresponding to the Terraform Plugin [changelog categories](https://developer.hashicorp.com/terraform/plugin/sdkv2/best-practices/versioning#categorization)
106+
107+
Fill out the body field following the entry format. Changie will then prompt for a Github issue or pull request number.
108+
109+
Repeat this process for any additional changes. The `.yaml` files created in the `.changes/unreleased` folder
110+
should be pushed the repository along with any code changes.
111+
96112
#### Entry format
97113

98114
Entries that are specific to _resources_ or _data sources_, they should look like:
99115

100116
```markdown
101-
* resource/RESOURCE_NAME: ENTRY DESCRIPTION ([#PR_NUMBER](PR_URL)).
117+
* resource/RESOURCE_NAME: ENTRY DESCRIPTION.
102118

103-
* data-source/DATA-SOURCE_NAME: ENTRY DESCRIPTION ([#PR_NUMBER](PR_URL)).
119+
* data-source/DATA-SOURCE_NAME: ENTRY DESCRIPTION.
104120
```
105121

106122
#### Which changes should appear in the `CHANGELOG`?

.github/workflows/release.yml

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,105 @@
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
contents: write
1017

1118
jobs:
19+
changelog-version:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
version: ${{ steps.changelog-version.outputs.version }}
23+
steps:
24+
- id: changelog-version
25+
run: echo "version=$(echo "${{ inputs.versionNumber }}" | cut -c 2-)" >> "$GITHUB_OUTPUT"
26+
changelog:
27+
needs: changelog-version
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
32+
with:
33+
fetch-depth: 0
34+
- name: Batch changes
35+
uses: miniscruff/changie-action@7d8e4c245da691d57ca34019a0504321fa7b7e07 # v1.0.0
36+
with:
37+
version: latest
38+
args: batch ${{ needs.changelog-version.outputs.version }}
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Merge changes
42+
uses: miniscruff/changie-action@7d8e4c245da691d57ca34019a0504321fa7b7e07 # v1.0.0
43+
with:
44+
version: latest
45+
args: merge
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Git push changelog
49+
run: |
50+
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
51+
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
52+
git add .
53+
git commit -a -m "Update changelog"
54+
git push
55+
release-tag:
56+
needs: changelog
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
61+
with:
62+
fetch-depth: 0
63+
- name: Git push release tag
64+
run: |
65+
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
66+
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
67+
git pull
68+
git tag "${{ inputs.versionNumber }}"
69+
git push origin "${{ inputs.versionNumber }}"
1270
release-notes:
71+
needs: [ changelog-version, changelog, release-tag ]
1372
runs-on: ubuntu-latest
1473
steps:
1574
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
1675
with:
76+
ref: ${{ inputs.versionNumber }}
1777
fetch-depth: 0
1878
- name: Generate Release Notes
19-
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 > release-notes.txt
79+
run: |
80+
cd .changes
81+
sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > release-notes.txt
2082
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2183
with:
2284
name: release-notes
23-
path: release-notes.txt
85+
path: ./.changes/release-notes.txt
2486
retention-days: 1
2587
terraform-provider-release:
2688
name: 'Terraform Provider Release'
27-
needs: [release-notes]
89+
needs: [ release-notes ]
2890
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@106e6d08159ccec423310cc2c706bae59f46c09c # v2.2.0
2991
secrets:
30-
hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}'
31-
hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}'
32-
hc-releases-host-prod: '${{ secrets.HC_RELEASES_HOST_PROD }}'
3392
hc-releases-key-prod: '${{ secrets.HC_RELEASES_KEY_PROD }}'
3493
hc-releases-key-staging: '${{ secrets.HC_RELEASES_KEY_STAGING }}'
94+
hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}'
3595
hc-releases-terraform-registry-sync-token: '${{ secrets.TF_PROVIDER_RELEASE_TERRAFORM_REGISTRY_SYNC_TOKEN }}'
3696
setup-signore-github-token: '${{ secrets.HASHI_SIGNORE_GITHUB_TOKEN }}'
3797
signore-client-id: '${{ secrets.SIGNORE_CLIENT_ID }}'
3898
signore-client-secret: '${{ secrets.SIGNORE_CLIENT_SECRET }}'
99+
hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}'
100+
hc-releases-host-prod: '${{ secrets.HC_RELEASES_HOST_PROD }}'
39101
with:
40102
release-notes: true
41103
setup-go-version-file: 'go.mod'
42-
# Product Version (e.g. v1.2.3 or github.ref_name)
43-
product-version: '${{ github.ref_name }}'
104+
# Product Version (e.g. v1.2.3)
105+
product-version: '${{ inputs.versionNumber }}'

0 commit comments

Comments
 (0)