From 1c0616f32053605110839c0a13ed9111823fb037 Mon Sep 17 00:00:00 2001 From: Morgante Pell Date: Tue, 21 Jan 2020 16:34:44 -0500 Subject: [PATCH] Chore: Add changelog + generation (#66) * Chore: fix changelog * Add workflows for releasing --- .github/workflows/generate-changelog.yaml | 40 +++++++++++++++++++++++ .github/workflows/release.yaml | 40 +++++++++++++++++++++++ CHANGELOG.md | 12 ++++--- 3 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/generate-changelog.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/generate-changelog.yaml b/.github/workflows/generate-changelog.yaml new file mode 100644 index 00000000..783091c3 --- /dev/null +++ b/.github/workflows/generate-changelog.yaml @@ -0,0 +1,40 @@ +name: Generate new release changelog +on: + push: + branches: + - master + repository_dispatch: + types: generate-pr + schedule: + - cron: '0 2 * * *' +jobs: + createPullRequest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + - name: Update dependencies + run: npm install -g standard-version + - name: Generate changelog + run: | + standard-version + - run: git checkout "${GITHUB_REF:11}" + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + labels: chore + team-reviewers: terraform-google-modules/cft-admins + commit-message: 'chore(release): generate CHANGELOG for new version' + title: '[Release] New version notes' + body: | + Update changelog with information on next version. + branch: chore/changelog-generation + - name: Check outputs + run: | + echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" + echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..309a52bf --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,40 @@ +name: Create Release +on: + push: + branches: + - master + repository_dispatch: + types: generate-pr +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: read changelog + run: cat CHANGELOG.md | grep -o -P "\d\.\d\.\d" | head -n 1 + - name: find release + id: find_version + run: | + VERSION=$(cat CHANGELOG.md | grep -o -P "\d\.\d\.\d" | head -n 1) + TAG=$(git describe --abbrev=0 --tags) + echo "::set-output name=version::v$VERSION" + echo "::set-output name=tag::$TAG" + - name: Check outputs + run: | + echo "Version Number - ${{ steps.find_version.outputs.version }}" + echo "Latest Tag - ${{ steps.find_version.outputs.tag }}" + - name: Create Release + id: create_release + if: steps.find_version.outputs.tag != steps.find_version.outputs.version + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.find_version.outputs.version }} + release_name: Release ${{ steps.find_version.outputs.version }} + body: | + Release ${{ steps.find_version.outputs.version }} + draft: false + prerelease: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 95e14c00..2d87ad95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ -# Change Log +# Changelog -All notable changes to this project will be documented in this file. +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. -The format is based on [Keep a Changelog](http://keepachangelog.com/) and this -project adheres to [Semantic Versioning](http://semver.org/). +### [1.4.1](https://github.com/terraform-google-modules/terraform-google-vm/compare/v1.4.0...v1.4.1) (2020-01-21) -## [Unreleased] + +### Bug Fixes + +* 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)) ## [1.4.0] - 2020-01-08