Skip to content

Commit

Permalink
initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelamattes committed May 9, 2022
1 parent a0c9519 commit e3572d9
Show file tree
Hide file tree
Showing 13 changed files with 779 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# Format and labels used aim to match those used by Ansible project
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: 'Major Changes'
labels:
- 'major' # c6476b
- title: 'Minor Changes'
labels:
- 'feature' # 006b75
- 'enhancement' # ededed
- 'refactoring'
- title: 'Bugfixes'
labels:
- 'bug' # fbca04
- title: 'Deprecations'
labels:
- 'deprecated' # fef2c0
exclude-labels:
- 'skip-changelog'
- 'duplicate'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
- 'enhancement'
- 'refactoring'
patch:
labels:
- 'patch'
- 'bug'
- 'deprecated'
default: patch
autolabeler:
- label: 'skip-changelog'
title: '/chore/i'
- label: 'bug'
title: '/fix/i'
- label: 'enhancement'
title: '/(enhance|improve)/i'
- label: 'feature'
title: '/feature/i'
- label: 'dreprecated'
title: '/deprecat/i'
template: |
$CHANGES
Kudos goes to: $CONTRIBUTORS
24 changes: 24 additions & 0 deletions .github/workflows/prettier-md.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# https://github.com/creyD/prettier_action
name: Prettier markdown files

on:
push:
paths:
- '**.md'

jobs:
prettier-md:
runs-on: ubuntu-latest
timeout-minutes: 1

steps:
- name: Git checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Prettify code
uses: creyD/prettier_action@v3.1
with:
prettier_options: --write {**/*,*}.md
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: New release

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- main

jobs:
generate_changelog:
runs-on: ubuntu-latest
name: create release draft
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: calculate next version
id: version
uses: patrickjahns/version-drafter-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate changelog
uses: charmixer/auto-changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
future_release: ${{ steps.version.outputs.next-version }}

- name: Generate readme
uses: terraform-docs/gh-actions@main
with:
working-dir: .
output-file: README.md
output-method: inject

- name: push changelog and readme
uses: github-actions-x/commit@v2.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'main'
commit-message: 'update changelog'
force-add: 'true'
files: CHANGELOG.md README.md
name: T-Systems MMS
email: frage@t-systems-mms.com

# do a second checkout to prevent race situation
# changelog gets updated but action works on old commit id
- uses: actions/checkout@v2.3.4
with:
ref: main

- name: Generate changelog for the release
run: |
sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
- name: Read CHANGELOG.md
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./CHANGELOGRELEASE.md

- name: Create Release draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_name: ${{ steps.version.outputs.next-version }}
tag_name: ${{ steps.version.outputs.next-version }}
body: |
${{ steps.package.outputs.content }}
draft: true
23 changes: 23 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Terraform

on: [push, pull_request]

jobs:
terraform-lint:
runs-on: ubuntu-latest

steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1

- name: fmt
run: terraform fmt -recursive -check
continue-on-error: true

- name: init
run: terraform init

- name: validate
run: terraform validate -no-color
46 changes: 46 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
formatter: template

sections:
show:
- header
- requirements
- providers
- resources
- modules
- inputs
- outputs
- footer

content: |-
{{ .Header }}
<-- This file is autogenerated, please do not change. -->
{{ .Requirements }}
{{ .Providers }}
{{ .Resources }}
{{ .Inputs }}
{{ .Outputs }}
## Examples
```hcl
{{ include "examples/main.tf" }}
```
sort:
enabled: true
by: required

settings:
indent: 2
hide-empty: true
anchor: false
escape: false
required: true
type: true
read-comments: true
Loading

0 comments on commit e3572d9

Please sign in to comment.