Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/git-chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{ range .Versions }}
{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ if .Body }}> {{ .Body }} {{ end }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts

{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
32 changes: 32 additions & 0 deletions .github/git-chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/sysdiglabs/terraform-google-secure
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
ci: Continuous Integration
docs: Documentation
chore: Small Modifications
build: Compilation & Dependencies
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
76 changes: 44 additions & 32 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,47 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Extract tag name
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
body: |
This is the ${{ github.ref }} release of ${{ env.GITHUB_REPOSITORY }}

### Major Changes
### Minor Changes
### Bug fixes

- name: Build and push Docker image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
repository: ${{ env.GITHUB_REPOSITORY }}
add_git_labels: true
dockerfile: build/Dockerfile
tags: latest, ${{ steps.tag.outputs.VERSION }}
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15'

- name: Setup go-chglog
working-directory: /tmp
env:
VERSION: "0.10.0"
run: |
wget https://github.com/git-chglog/git-chglog/releases/download/v${VERSION}/git-chglog_${VERSION}_linux_amd64.tar.gz
gunzip git-chglog_${VERSION}_linux_amd64.tar.gz
tar -xvf git-chglog_${VERSION}_linux_amd64.tar
sudo mv git-chglog /usr/local/bin/

- name: Generate changelog
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md

# Check if we need to build using dockerfile in the release. If yes, uncomment below.
#- name: Build and push Docker image
# uses: docker/build-push-action@v1
# with:
# username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
# password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
# repository: ${{ env.GITHUB_REPOSITORY }}
# add_git_labels: true
# dockerfile: build/Dockerfile
# tags: latest, ${{ steps.tag.outputs.VERSION }}