Skip to content

Commit

Permalink
Merge pull request #4 from sysdiglabs/automate_release_process
Browse files Browse the repository at this point in the history
Automate release process via github action
  • Loading branch information
marojor authored Feb 28, 2022
2 parents b9e0795 + 2d63f1c commit 4ba888b
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
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 -}}
26 changes: 26 additions & 0 deletions .github/git-chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/sysdiglabs/terraform-aws-fargate-orchestrator-agent
options:
commits:
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
45 changes: 45 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-latest

steps:
- 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

0 comments on commit 4ba888b

Please sign in to comment.