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 6a3ddcf commit 044558e
Show file tree
Hide file tree
Showing 15 changed files with 496 additions and 63 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

...
4 changes: 1 addition & 3 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ branches:
required_pull_request_reviews: null
required_status_checks:
strict: true
contexts:
- linting
- testing
contexts: []
enforce_admins: false
restrictions:
apps:
Expand Down
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
}
]
]
}
Loading

0 comments on commit 044558e

Please sign in to comment.