Skip to content

Commit ba16c64

Browse files
authored
chore: prepare release v1.0.7 (#16)
* chore: prepare release v1.0.7 * chore: added release scripts
1 parent b914e09 commit ba16c64

File tree

4 files changed

+59
-9
lines changed

4 files changed

+59
-9
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM derekrada/terraform-docs:latest
1+
FROM derekrada/terraform-docs:v1.0.7
22
COPY ./src/common.sh /common.sh
33
COPY ./src/docker-entrypoint.sh /docker-entrypoint.sh
44

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# terraform-docs
22
A Github action for generating terraform module documentation using terraform-docs and gomplate. In addition to statically defined directory modules, this module can search specific sub folders or parse atlantis.yaml for module identification and doc generation. This action has the ability to auto commit docs to an open PR or after a push to a specific branch.
33
## Version
4-
v1.0.6
4+
v1.0.7
55

6-
Using [terraform-docs](https://github.com/segmentio/terraform-docs) v0.8.0, which is supported and tested on terraform version 0.11+ & 0.12+ but may work for others.
6+
Using [terraform-docs](https://github.com/segmentio/terraform-docs) v0.8.2, which is supported and tested on terraform version 0.11+ & 0.12+ but may work for others.
77

88

99

@@ -22,7 +22,7 @@ jobs:
2222
ref: ${{ github.event.pull_request.head.ref }}
2323

2424
- name: Render terraform docs inside the USAGE.md and push changes back to PR branch
25-
uses: Dirrk/[email protected].6
25+
uses: Dirrk/[email protected].7
2626
with:
2727
tf_docs_working_dir: .
2828
tf_docs_output_file: USAGE.md
@@ -118,7 +118,7 @@ jobs:
118118
## Simple / Single folder
119119
```
120120
- name: Generate TF Docs
121-
uses: Dirrk/[email protected].6
121+
uses: Dirrk/[email protected].7
122122
with:
123123
tf_docs_working_dir: .
124124
tf_docs_output_file: README.md
@@ -127,7 +127,7 @@ jobs:
127127
## Multi folder
128128
```
129129
- name: Generate TF Docs
130-
uses: Dirrk/[email protected].6
130+
uses: Dirrk/[email protected].7
131131
with:
132132
tf_docs_working_dir: .,example1,example3/modules/test
133133
tf_docs_output_file: README.md
@@ -136,17 +136,17 @@ jobs:
136136
## Use atlantis.yaml v3 to find all dirs
137137
```
138138
- name: Generate TF docs
139-
uses: Dirrk/[email protected].6
139+
uses: Dirrk/[email protected].7
140140
with:
141141
tf_docs_atlantis_file: atlantis.yaml
142142
```
143143
144144
## Find all .tf file folders under a given directory
145145
```yaml
146146
- name: Generate TF docs
147-
uses: Dirrk/[email protected].6
147+
uses: Dirrk/[email protected].7
148148
with:
149149
tf_docs_find_dir: examples/
150150
```
151151

152-
Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.6/examples)
152+
Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.7/examples)

scripts/pre-release.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
NEW_VERSION=$1
5+
6+
if [ -z "${NEW_VERSION}" ]; then
7+
echo "Must have version like: v1.0.1"
8+
exit 1
9+
fi
10+
11+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
12+
13+
if [[ "${CURRENT_BRANCH}" == "master" ]]; then
14+
git pull origin master
15+
git checkout -b "release/${NEW_VERSION}"
16+
elif [[ "${CURRENT_BRANCH}" == "release/${NEW_VERSION}" ]]; then
17+
git pull origin master
18+
else
19+
echo "Invalid branch"
20+
exit 1
21+
fi
22+
23+
# Update the README
24+
VERSION=$NEW_VERSION gomplate -d action=action.yml -f .github/templates/README.tpl -o README.md
25+
26+
# Update Dockerfile
27+
gsed -i "s|FROM derekrada/terraform-docs:.*|FROM derekrada/terraform-docs:${NEW_VERSION}|" ./Dockerfile
28+
29+
git commit -am "chore: prepare release ${NEW_VERSION}"
30+
git push --set-upstream origin "release/${NEW_VERSION}"

scripts/release.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
5+
6+
if [[ "${CURRENT_BRANCH}" != "master" ]]; then
7+
echo "Must be on master"
8+
exit 1
9+
fi
10+
11+
NEW_VERSION=$1
12+
13+
if [ -z "${NEW_VERSION}" ]; then
14+
echo "Must have version like: v1.0.1"
15+
exit 1
16+
fi
17+
18+
git pull origin master
19+
git tag "${NEW_VERSION}"
20+
git push --tags

0 commit comments

Comments
 (0)