Skip to content

Commit 82ed540

Browse files
author
Néstor Salceda
authored
feat: Automate release process (#43)
* feat: Add a release workflow * refactor: Python is no longer needed
1 parent e8fcacd commit 82ed540

File tree

5 files changed

+118
-44
lines changed

5 files changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,14 @@ on:
66
- main
77

88
jobs:
9-
lint:
10-
name: Lint
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Check out code
15-
uses: actions/checkout@v2
16-
17-
- name: cfn-lint
18-
uses: scottbrenner/cfn-lint-action@master
19-
with:
20-
args: "templates/**/*.yaml"
21-
229
build:
2310
name: Build and Upload
2411
runs-on: ubuntu-latest
25-
needs: [lint]
2612

2713
steps:
2814
- name: Check out code
2915
uses: actions/checkout@v2
3016

31-
- name: Setup Python
32-
uses: actions/setup-python@v2
33-
with:
34-
python-version: '3.8'
35-
36-
- uses: actions/cache@v2
37-
with:
38-
path: ~/.cache
39-
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
40-
restore-keys: |
41-
${{ runner.os }}-pipenv-
42-
43-
- name: Install pipenv
44-
run: python -m pip install pipenv
45-
4617
- name: Configure AWS credentials
4718
uses: aws-actions/configure-aws-credentials@v1
4819
with:

.github/workflows/ci-pull-request.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ jobs:
2828
- name: Check out code
2929
uses: actions/checkout@v2
3030

31-
- name: Setup Python
32-
uses: actions/setup-python@v2
33-
with:
34-
python-version: '3.8'
35-
36-
- uses: actions/cache@v2
37-
with:
38-
path: ~/.cache
39-
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
40-
restore-keys: |
41-
${{ runner.os }}-pipenv-
42-
43-
- name: Install pipenv
44-
run: python -m pip install pipenv
45-
4631
- name: Configure AWS credentials
4732
uses: aws-actions/configure-aws-credentials@v1
4833
with:

.github/workflows/release.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
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.16
21+
22+
- name: Setup go-chglog
23+
run: go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
24+
25+
- name: Generate changelog
26+
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
27+
28+
- name: Create release
29+
id: create_release
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: ${{ github.ref }}
36+
draft: true
37+
prerelease: false
38+
body_path: RELEASE_CHANGELOG.md
39+
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v1
42+
with:
43+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
44+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
45+
aws-region: eu-west-1
46+
47+
- name: Build and Upload Version
48+
run: make ci
49+
working-directory: ./templates
50+
env:
51+
S3_BUCKET: cf-templates-cloudvision-ci
52+
S3_PREFIX: ${{ github.ref }}
53+
54+
- name: Build and Upload Latest
55+
run: make ci
56+
working-directory: ./templates
57+
env:
58+
S3_BUCKET: cf-templates-cloudvision-ci
59+
S3_PREFIX: latest

0 commit comments

Comments
 (0)