Skip to content

Commit 358a205

Browse files
authored
Merge pull request #23 from hashicorp/readme
Add Readme and License
2 parents 10b0ad2 + a327d86 commit 358a205

File tree

110 files changed

+822
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+822
-40
lines changed

.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: Same testing functionality as that of terraform-plugin-sdk v2.24.1, repacked
3+
in a standalone repository
4+
time: 2023-01-10T12:37:37.053752-05:00
5+
custom:
6+
Issue/PR Number: "24"

.changie.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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-testing/issues/{{.Custom.Issue}}))'
8+
custom:
9+
- key: Issue/PR Number
10+
type: int
11+
minInt: 1
12+
kinds:
13+
- label: BREAKING CHANGES
14+
- label: NOTES
15+
- label: FEATURES
16+
- label: IMPROVEMENTS
17+
- label: BUG FIXES
18+
newlines:
19+
afterKind: 1
20+
beforeKind: 1
21+
endOfVersion: 2

.copywrite.hcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
schema_version = 1
2+
3+
project {
4+
license = "MPL-2.0"
5+
copyright_year = 2014
6+
}

.github/CONTRIBUTING.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ attaching use cases to an issue first before raising a pull request.
108108
commands). Where possible it is better to raise a separate pull request with
109109
just dependency changes as it's easier to review such PR(s).
110110

111+
- [ ] **Changelog**: We use the [Changie](https://changie.dev/) automation tool
112+
for changelog automation. To add a new entry to the `CHANGELOG` install Changie
113+
using the following [instructions](https://changie.dev/guide/installation/)
114+
and run `changie new` then choose a `kind` of change corresponding to the Terraform
115+
Plugin [changelog categories](https://developer.hashicorp.com/terraform/plugin/sdkv2/best-practices/versioning#categorization)
116+
and then fill out the body following the entry format. Changie will then prompt for
117+
a Github issue or pull request number. Repeat this process for any additional changes.
118+
The `.yaml` files created in the `.changes/unreleased` folder should be pushed the repository
119+
along with any code changes.
120+
111121
### Cosmetic changes, code formatting, and typos
112122

113123
In general we do not accept PRs containing only the following changes:
@@ -221,30 +231,8 @@ This section is dedicated to the maintainers of this project.
221231

222232
### Releases
223233

224-
Before running a release, the changelog must be constructed from unreleased entries in the `.changelog` directory.
225-
226-
Install the latest version of the [`changelog-build`](https://pkg.go.dev/github.com/hashicorp/go-changelog/cmd/changelog-build) command, if it not already available:
227-
228-
```shell
229-
go install github.com/hashicorp/go-changelog/cmd/changelog-build
230-
```
231-
232-
Run the [`changelog-build`](https://pkg.go.dev/github.com/hashicorp/go-changelog/cmd/changelog-build) command from the root directory of the repository:
233-
234-
```shell
235-
changelog-build -changelog-template .changelog.tmpl -entries-dir .changelog -last-release $(git describe --tags --abbrev=0) -note-template .changelog-note.tmpl -this-release HEAD
236-
```
237-
238-
This will generate a section of Markdown text for the next release. Open the `CHANGELOG.md` file, add a `# X.Y.Z` header as the first line, then add the output from the `changelog-build` command.
239-
240-
Commit, push, create a release Git tag, and push the tag:
241-
242-
```shell
243-
git add CHANGELOG.md
244-
git commit -m "Update CHANGELOG for v1.2.3"
245-
git push
246-
git tag v1.2.3
247-
git push --tags
248-
```
249-
250-
GitHub Actions will pick up the new release tag and kick off the release workflow.
234+
To cut a release, go to the repository in Github and click on the `Actions` tab
235+
and select the `Release` workflow on the left-hand menu. In the `Release` submenu,
236+
click on the Run workflow button, select the branch to cut the release from (default is main)
237+
and input the `Release version number` which is the Semantic Release number including
238+
the `v` prefix (i.e. `v1.4.0`) and click `Run workflow`

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
14
blank_issues_enabled: false
25
contact_links:
36
- name: Terraform Language or Workflow Feedback and Questions

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ labels: enhancement
88
<!--
99
Inspect your go.mod as below to find the version, and paste the result between the ``` marks below.
1010
11-
go list -m github.com/hashicorp/terraform-plugin-log/...
11+
go list -m github.com/hashicorp/terraform-plugin-testing/...
1212
13-
If you are not running the latest version of terraform-plugin-log, please try
13+
If you are not running the latest version of terraform-plugin-testing, please try
1414
upgrading because your feature may have already been implemented.
1515
-->
1616
```
@@ -28,7 +28,7 @@ a moment, below!
2828

2929
### Attempted solutions
3030
<!---
31-
If you've already tried to solve the problem within terraform-plugin-log's
31+
If you've already tried to solve the problem within terraform-plugin-testing's
3232
existing features and found a limitation that prevented you from succeeding,
3333
please describe it below in as much detail as possible.
3434
@@ -43,7 +43,7 @@ configuration snippets and commands.
4343
### Proposal
4444
<!---
4545
If you have an idea for a way to address the problem via a change to
46-
terraform-plugin-log, please describe it below.
46+
terraform-plugin-testing, please describe it below.
4747
4848
In this section, it's helpful to include specific examples of how what you are
4949
suggesting might look like in configuration files, on the command line, or in

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
14
version: 2
25
updates:
36
- package-ecosystem: "github-actions"

.github/workflows/release.yml

Lines changed: 67 additions & 7 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'
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,21 +19,74 @@ 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@v3
35+
with:
36+
fetch-depth: 0
37+
- name: Batch changes
38+
uses: miniscruff/changie-action@v0
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@v0
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@v3
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@v3
1978
with:
20-
# Required for release notes
79+
ref: ${{ inputs.versionNumber }}
2180
fetch-depth: 0
2281
- uses: actions/setup-go@v3
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@v4
2989
env:
3090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3191
with:
32-
args: release --release-notes /tmp/release-notes.txt --rm-dist
92+
args: release --release-notes /tmp/release-notes.txt --rm-dist

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
6+
and is generated by [Changie](https://github.com/miniscruff/changie).
7+
8+
9+
No releases yet, this file will be updated when generating your first release.

0 commit comments

Comments
 (0)