Skip to content

Commit

Permalink
feat: restructure workflows and enable automated releases
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Jan 5, 2023
1 parent f1a275f commit 5d9087e
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 58 deletions.
63 changes: 27 additions & 36 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"config:base",
":semanticCommits",
":semanticCommitType(deps)",
":automergePatch"
":automergeMinor"
],
"regexManagers": [{
"fileMatch": [
"defaults/main.yml"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>.*?))?\\n.*?_version: (?<currentValue>.*)\\s"
]
}],
"packageRules": [{
"regexManagers": [
{
"fileMatch": [
"defaults/main.yml"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>.*?))?\\n.*?_version: (?<currentValue>.*)\\s"
]
}
],
"packageRules": [
{
"description": "Strip v prefix from versions",
"groupName": "version prefix",
"matchDatasources": [
Expand All @@ -23,49 +26,37 @@
"extractVersion": "^v(?<version>.*)$"
},
{
"description": "Semantic commits for major updates",
"groupName": "major updates",
"matchDatasources": [
"github-releases",
"github-tags",
"galaxy-collection"
],
"description": "Semantic commits for major versions",
"groupName": "major versions",
"matchUpdateTypes": [
"major"
],
"semanticCommitScope": "major",
"semanticCommitType": "major",
"semanticCommitScope": "deps",
"automerge": false
},
{
"description": "Semantic commits for minor updates",
"groupName": "minor updates",
"matchDatasources": [
"github-releases",
"github-tags",
"galaxy-collection"
],
"description": "Semantic commits for minor versions",
"groupName": "minor versions",
"matchUpdateTypes": [
"minor"
],
"semanticCommitScope": "minor",
"automerge": false
"semanticCommitType": "minor",
"semanticCommitScope": "deps",
"automerge": true
},
{
"description": "Semantic commits for patch updates",
"groupName": "patch updates",
"matchDatasources": [
"github-releases",
"github-tags",
"galaxy-collection"
],
"description": "Semantic commits for patch versions",
"groupName": "patch versions",
"matchUpdateTypes": [
"patch"
],
"semanticCommitScope": "patch",
"semanticCommitType": "patch",
"semanticCommitScope": "deps",
"automerge": true
}
],
"labels": [
"renovate"
]
}
}
23 changes: 23 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
commitsOnly: true
anyCommit: true
allowMergeCommits: true
allowRevertCommits: true

types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
- major
- minor
- patch

...
15 changes: 13 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ repository:

private: false
has_issues: true
has_projects: false
has_wiki: false
has_downloads: false

Expand All @@ -16,6 +15,12 @@ repository:
allow_merge_commit: true
allow_rebase_merge: true

allow_update_branch: true
allow_auto_merge: true
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true

labels:
- name: bug
color: d73a4a
Expand Down Expand Up @@ -54,12 +59,18 @@ labels:
branches:
- name: master
protection:
required_pull_request_reviews: null
required_status_checks:
strict: true
contexts: []
enforce_admins: false
restrictions:
apps:
- renovate
users: []
teams: []
teams:
- admins
- bots
- members

...
4 changes: 2 additions & 2 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: galaxy

'on':
"on":
push:
branches:
- master
Expand All @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v3

- name: Galaxy upload
uses: robertdebock/galaxy-action@1.2.0
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.GALAXY_TOKEN }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: general

'on':
"on":
push:
branches:
- master
Expand All @@ -28,18 +28,18 @@ jobs:

matrix:
scenario:
- ubuntu
- default

steps:
- name: Checkout source
uses: actions/checkout@v3
with:
path: ${{ github.repository }}

- name: Molecule tests
uses: gofrolist/molecule-action@v2
with:
molecule_command: test
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
ANSIBLE_FORCE_COLOR: "1"

...
6 changes: 4 additions & 2 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: readme

'on':
"on":
push:
branches:
- master
Expand All @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

- name: Generate readme
uses: actionhippie/ansible-doctor@v1
Expand All @@ -26,7 +28,7 @@ jobs:
author_name: GitHub Actions
author_email: github@webhippie.de
add: README.md
message: automated readme update [skip ci]
message: "docs: automated readme update [skip ci]"
push: true
commit: --signoff

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: release

"on":
push:
branches:
- master
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

- name: Semantic release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }}
with:
extra_plugins: |
conventional-changelog-conventionalcommits
...
110 changes: 110 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "major",
"release": "major"
},
{
"type": "deps",
"scope": "major",
"release": "major"
},
{
"type": "minor",
"release": "minor"
},
{
"type": "deps",
"scope": "minor",
"release": "minor"
},
{
"type": "patch",
"release": "patch"
},
{
"type": "deps",
"scope": "patch",
"release": "patch"
},
{
"type": "refactor",
"release": "minor"
},
{
"scope": "docs",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "major",
"section": "Features"
},
{
"type": "minor",
"section": "Features"
},
{
"type": "fix",
"section": "Bugfixes"
},
{
"type": "patch",
"section": "Bugfixes"
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "refactor",
"hidden": true
}
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog"
}
],
[
"@semantic-release/git",
{
"message": "chore: release ${nextRelease.version}"
}
],
[
"@semantic-release/github",
{
"addReleases": true
}
]
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# root

[![Source Code](https://img.shields.io/badge/github-source%20code-blue?logo=github&logoColor=white)](https://github.com/rolehippie/root) [![Testing Build](https://github.com/rolehippie/root/workflows/testing/badge.svg)](https://github.com/rolehippie/root/actions?query=workflow%3Atesting) [![Readme Build](https://github.com/rolehippie/root/workflows/readme/badge.svg)](https://github.com/rolehippie/root/actions?query=workflow%3Areadme) [![Galaxy Build](https://github.com/rolehippie/root/workflows/galaxy/badge.svg)](https://github.com/rolehippie/root/actions?query=workflow%3Agalaxy) [![License: Apache-2.0](https://img.shields.io/github/license/rolehippie/root)](https://github.com/rolehippie/root/blob/master/LICENSE)
[![Source Code](https://img.shields.io/badge/github-source%20code-blue?logo=github&logoColor=white)](https://github.com/rolehippie/root) [![General Workflow](https://github.com/rolehippie/root/actions/workflows/general.yml/badge.svg)](https://github.com/rolehippie/root/actions/workflows/general.yml) [![Readme Workflow](https://github.com/rolehippie/root/actions/workflows/readme.yml/badge.svg)](https://github.com/rolehippie/root/actions/workflows/readme.yml) [![Galaxy Workflow](https://github.com/rolehippie/root/actions/workflows/galaxy.yml/badge.svg)](https://github.com/rolehippie/root/actions/workflows/galaxy.yml) [![License: Apache-2.0](https://img.shields.io/github/license/rolehippie/root)](https://github.com/rolehippie/root/blob/master/LICENSE) [![Ansible Role](https://img.shields.io/ansible/role/51436)](https://galaxy.ansible.com/rolehippie/root)

Ansible role to configure the system root user.

Expand Down
Loading

0 comments on commit 5d9087e

Please sign in to comment.