Skip to content

Commit 1c0616f

Browse files
authored
Chore: Add changelog + generation (#66)
* Chore: fix changelog * Add workflows for releasing
1 parent 3e2c8cd commit 1c0616f

File tree

3 files changed

+87
-5
lines changed

3 files changed

+87
-5
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Generate new release changelog
2+
on:
3+
push:
4+
branches:
5+
- master
6+
repository_dispatch:
7+
types: generate-pr
8+
schedule:
9+
- cron: '0 2 * * *'
10+
jobs:
11+
createPullRequest:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
16+
- uses: actions/setup-node@v1
17+
with:
18+
node-version: '10.x'
19+
- name: Update dependencies
20+
run: npm install -g standard-version
21+
- name: Generate changelog
22+
run: |
23+
standard-version
24+
- run: git checkout "${GITHUB_REF:11}"
25+
- name: Create Pull Request
26+
id: cpr
27+
uses: peter-evans/create-pull-request@v2
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
labels: chore
31+
team-reviewers: terraform-google-modules/cft-admins
32+
commit-message: 'chore(release): generate CHANGELOG for new version'
33+
title: '[Release] New version notes'
34+
body: |
35+
Update changelog with information on next version.
36+
branch: chore/changelog-generation
37+
- name: Check outputs
38+
run: |
39+
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
40+
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"

.github/workflows/release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
repository_dispatch:
7+
types: generate-pr
8+
jobs:
9+
build:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
15+
- name: read changelog
16+
run: cat CHANGELOG.md | grep -o -P "\d\.\d\.\d" | head -n 1
17+
- name: find release
18+
id: find_version
19+
run: |
20+
VERSION=$(cat CHANGELOG.md | grep -o -P "\d\.\d\.\d" | head -n 1)
21+
TAG=$(git describe --abbrev=0 --tags)
22+
echo "::set-output name=version::v$VERSION"
23+
echo "::set-output name=tag::$TAG"
24+
- name: Check outputs
25+
run: |
26+
echo "Version Number - ${{ steps.find_version.outputs.version }}"
27+
echo "Latest Tag - ${{ steps.find_version.outputs.tag }}"
28+
- name: Create Release
29+
id: create_release
30+
if: steps.find_version.outputs.tag != steps.find_version.outputs.version
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ steps.find_version.outputs.version }}
36+
release_name: Release ${{ steps.find_version.outputs.version }}
37+
body: |
38+
Release ${{ steps.find_version.outputs.version }}
39+
draft: false
40+
prerelease: false

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# Change Log
1+
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
6-
project adheres to [Semantic Versioning](http://semver.org/).
5+
### [1.4.1](https://github.com/terraform-google-modules/terraform-google-vm/compare/v1.4.0...v1.4.1) (2020-01-21)
76

8-
## [Unreleased]
7+
8+
### Bug Fixes
9+
10+
* derive project id for instance from instance template ([#63](https://github.com/terraform-google-modules/terraform-google-vm/issues/63)) ([3e2c8cd](https://github.com/terraform-google-modules/terraform-google-vm/commit/3e2c8cdeb2d0e6f1fe53bc2d0a9369c9dc59f013))
911

1012
## [1.4.0] - 2020-01-08
1113

0 commit comments

Comments
 (0)