Skip to content

Commit 9df76c9

Browse files
Update and fix release workflows (#2)
Change summary: ----------------- 1. Updated the release action to not run build & push docker image step using a dockerfile, since it doesn't seem to be required. 2. The changes are in parity with terraform repo for AWS provider and also the terrafrom repo for GCP provider running cloudbench based installs.
1 parent d705cb1 commit 9df76c9

File tree

3 files changed

+104
-32
lines changed

3 files changed

+104
-32
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{ range .Versions }}
2+
{{ range .CommitGroups -}}
3+
### {{ .Title }}
4+
5+
{{ range .Commits -}}
6+
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
7+
{{ if .Body }}> {{ .Body }} {{ end }}
8+
{{ end }}
9+
{{ end -}}
10+
11+
{{- if .RevertCommits -}}
12+
### Reverts
13+
14+
{{ range .RevertCommits -}}
15+
* {{ .Revert.Header }}
16+
{{ end }}
17+
{{ end -}}
18+
19+
{{- if .NoteGroups -}}
20+
{{ range .NoteGroups -}}
21+
### {{ .Title }}
22+
23+
{{ range .Notes }}
24+
{{ .Body }}
25+
{{ end }}
26+
{{ end -}}
27+
{{ end -}}
28+
{{ end -}}

.github/git-chglog/config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/sysdiglabs/terraform-google-secure
6+
options:
7+
commits:
8+
# filters:
9+
# Type:
10+
# - feat
11+
# - fix
12+
# - perf
13+
# - refactor
14+
commit_groups:
15+
title_maps:
16+
feat: Features
17+
fix: Bug Fixes
18+
perf: Performance Improvements
19+
refactor: Code Refactoring
20+
ci: Continuous Integration
21+
docs: Documentation
22+
chore: Small Modifications
23+
build: Compilation & Dependencies
24+
header:
25+
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
26+
pattern_maps:
27+
- Type
28+
- Scope
29+
- Subject
30+
notes:
31+
keywords:
32+
- BREAKING CHANGE

.github/workflows/release.yaml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,47 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
14-
15-
- name: Extract tag name
16-
id: tag
17-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
18-
19-
- name: Create release
20-
id: create_release
21-
uses: actions/create-release@v1
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
with:
25-
tag_name: ${{ github.ref }}
26-
release_name: ${{ github.ref }}
27-
draft: true
28-
prerelease: false
29-
body: |
30-
This is the ${{ github.ref }} release of ${{ env.GITHUB_REPOSITORY }}
31-
32-
### Major Changes
33-
### Minor Changes
34-
### Bug fixes
35-
36-
- name: Build and push Docker image
37-
uses: docker/build-push-action@v1
38-
with:
39-
username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
40-
password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
41-
repository: ${{ env.GITHUB_REPOSITORY }}
42-
add_git_labels: true
43-
dockerfile: build/Dockerfile
44-
tags: latest, ${{ steps.tag.outputs.VERSION }}
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: '^1.15'
21+
22+
- name: Setup go-chglog
23+
working-directory: /tmp
24+
env:
25+
VERSION: "0.10.0"
26+
run: |
27+
wget https://github.com/git-chglog/git-chglog/releases/download/v${VERSION}/git-chglog_${VERSION}_linux_amd64.tar.gz
28+
gunzip git-chglog_${VERSION}_linux_amd64.tar.gz
29+
tar -xvf git-chglog_${VERSION}_linux_amd64.tar
30+
sudo mv git-chglog /usr/local/bin/
31+
32+
- name: Generate changelog
33+
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
34+
35+
- name: Create Release
36+
id: create_release
37+
uses: actions/create-release@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
tag_name: ${{ github.ref }}
42+
release_name: ${{ github.ref }}
43+
draft: true
44+
prerelease: false
45+
body_path: RELEASE_CHANGELOG.md
46+
47+
# Check if we need to build using dockerfile in the release. If yes, uncomment below.
48+
#- name: Build and push Docker image
49+
# uses: docker/build-push-action@v1
50+
# with:
51+
# username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
52+
# password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
53+
# repository: ${{ env.GITHUB_REPOSITORY }}
54+
# add_git_labels: true
55+
# dockerfile: build/Dockerfile
56+
# tags: latest, ${{ steps.tag.outputs.VERSION }}

0 commit comments

Comments
 (0)