diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform_and_release.yml similarity index 73% rename from .github/workflows/terraform.yml rename to .github/workflows/terraform_and_release.yml index 8867ea2..29227cb 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform_and_release.yml @@ -1,11 +1,7 @@ -name: 'Terraform GitHub Actions' +name: 'Terraform and Release' on: push: - branches: - - master pull_request: - branches: - - master jobs: terraform: name: 'Terraform' @@ -48,3 +44,20 @@ jobs: tf_actions_subcommand: 'validate' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: + if: github.event_name == 'push' + needs: terraform + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Semantic Release + id: semantic + uses: cycjimmy/semantic-release-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + semantic_version: 17 + extra_plugins: | + @semantic-release/changelog + @semantic-release/git diff --git a/README.md b/README.md index ce78548..fa620cf 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ There are two main components: - Forward Kinesis data stream events to Datadog, only CloudWatch logs are supported - Forward custom metrics from AWS Lambda functions via CloudWatch logs - Forward traces from AWS Lambda functions via CloudWatch logs - - Generate and submit enhanced Lambda metrics (aws.lambda.enhanced.*) parsed from the AWS REPORT log: duration, billed_duration, max_memory_used, and estimated_cost + - Generate and submit enhanced Lambda metrics (`aws.lambda.enhanced.*`) parsed from the AWS REPORT log: duration, billed_duration, max_memory_used, and estimated_cost ## Usage @@ -66,35 +66,23 @@ Cloudwatch log sync are namspaced by module. ## Examples -* [Full AWS Datadog integration](https://github.com/scribd/terraform-aws-datadog/tree/master/examples/full_integration) -* [Cloudwatch log sync only](https://github.com/scribd/terraform-aws-datadog/tree/master/examples/cloudwatch_log_sync) +- [Full AWS Datadog integration](https://github.com/scribd/terraform-aws-datadog/tree/master/examples/full_integration) +- [Cloudwatch log sync only](https://github.com/scribd/terraform-aws-datadog/tree/master/examples/cloudwatch_log_sync) ## Development -Releases are cut using [go-semrel-gitlab](https://gitlab.com/juhani/go-semrel-gitlab) +Releases are cut using [semantic-release](https://github.com/semantic-release/semantic-release). -Format commit messages using [Conventional Commits format](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) to determine the next version bump and to produce release notes +Please write commit messages following [Angular commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) -``` -type(scope): subject -``` -or -``` -type: subject -``` - -Types: -``` -minor bump: feat -patch bump: fix,refactor,perf,docs,style,tes -``` +### Release flow -When a commit contains a breaking change, the commit message should contain `BREAKING CHANGE:` +Semantic-release is configured with the [default branch workflow](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches) +For this project, releases will be cut from master as features and bugs are developed. -## Cutting a release ### Maintainers - [Jim](https://github.com/jim80net) diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..7497766 --- /dev/null +++ b/release.config.js @@ -0,0 +1,22 @@ +module.exports = { + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + "@semantic-release/github", + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +};