Skip to content

Commit

Permalink
feat: add github-actions-runners (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetOps authored Sep 7, 2021
1 parent e0da1ef commit 6a5b1d1
Show file tree
Hide file tree
Showing 20 changed files with 578 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @SweetOps
60 changes: 60 additions & 0 deletions .github/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR.$PATCH'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'enhancement'
# - 'feat'
patch:
labels:
- 'auto-update'
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
- 'refactor'
- 'ci'
- 'build'
- 'docs'
- 'test'
- 'chore'
- 'feat'
default: 'patch'

categories:
- title: '🚀 Enhancements'
labels:
- 'minor'
- 'enhancement'
- 'feat'
- title: '🐛 Bug Fixes'
labels:
- 'auto-update'
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
- 'refactor'
- 'ci'
- 'build'
- 'docs'
- 'test'
- 'chore'
- title: '🤖 Automatic Updates'
labels:
- 'auto-update'

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
27 changes: 27 additions & 0 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: v1

labels:
- label: "feat"
matcher:
title: "^feat:.*"
- label: "fix"
matcher:
title: "^fix:.*"
- label: "ci"
matcher:
title: "^ci:.*"
- label: "chore"
matcher:
title: "^chore:.*"
- label: "build"
matcher:
title: "^build:.*"
- label: "docs"
matcher:
title: "^docs:.*"
- label: "refactor"
matcher:
title: "^refactor:.*"
- label: "test"
matcher:
title: "^test:.*"
57 changes: 57 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# Default GitHub labels
- color: d73a4a
name: bug
description: Something isn't working
- color: cfd3d7
name: duplicate
description: This issue or pull request already exists
- color: a2eeef
name: enhancement
description: New feature or request
- color: 7057ff
name: good first issue
description: Good for newcomers
- color: 008672
name: help wanted
description: Extra attention is needed
- color: e4e669
name: invalid
description: This doesn't seem right
- color: d876e3
name: question
description: Further information is requested
- color: ffffff
name: wontfix
description: This will not be worked on

- color: a0040c
name: no-pr-activity
description: stalled PR
- color: d93f0b
name: no-issue-activity
description: stalled issue
- color: f9dcbd
name: build
description: Changes that affect the build system or external dependencies
- color: 63dae2
name: ci
description: Changes to our CI configuration files and scripts
- color: 6e93e5
name: docs
description: Documentation only changes
- color: 5edb3f
name: feat
description: A new feature
- color: 58e8c8
name: fix
description: A bug fix
- color: efada0
name: refactor
description: A code change that neither fixes a bug nor adds a feature
- color: 1d76db
name: test
description: Adding missing tests or correcting existing tests
- color: dfb443
name: chore
description: Adding missing tests or correcting existing tests
35 changes: 35 additions & 0 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.6.2

- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
31 changes: 31 additions & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Charts

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Fetch history
run: git fetch --prune --unshallow

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.6.2

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Label

on:
pull_request_target:

jobs:
labeler:
name: Auto Label
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config-path: .github/labeler.yaml
21 changes: 21 additions & 0 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Sync labels

on:
push:
branches:
- master
- main

jobs:
sync-labels:
name: Sync labels in the declarative way
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
with:
manifest: .github/labels.yaml
37 changes: 37 additions & 0 deletions .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR title conformance

on:
pull_request_target:

jobs:
main:
runs-on: ubuntu-latest

steps:
- name: Lint PR
uses: aslafy-z/conventional-pr-title-action@master
with:
preset: conventional-changelog-angular@^5.0.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment for PR title conformance
if: failure()
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{tojson(github.event.number)}}
body: |
Please ensure your PR conforms to conventional commits (see https://www.conventionalcommits.org).
Commits MUST be prefixed with a type, which consists of one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **test**: Adding missing tests or correcting existing tests
* **chore**: No production code change
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

name: Release Drafter

on:
push:
branches:
- master
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
publish: true
prerelease: false
config-name: auto-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 12 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
stale-pr-message: 'This pull-request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 30
days-before-close: 5
23 changes: 23 additions & 0 deletions charts/github-actions-runners/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/github-actions-runners/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: github-actions-runners
description: A Helm chart for provisioning Github Actions runners
type: application
version: 0.0.1
maintainers:
- name: SweetOps
Empty file.
Loading

0 comments on commit 6a5b1d1

Please sign in to comment.