Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Improve CI workflows #10

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/conventional-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Conventional Commit & PR

on:
pull_request:
# For forked repositories:
# pull_request_target:
# You can add specific pull request types too.
# If this is omitted, the workflow will only executed on opened, synchronize, and reopened
# which is enough for generic use cases.
# Below is the list of supported pull request sub-events
# types: [opened, reopened, ready_for_review, unlocked, synchronize]

jobs:
cpr:
name: Check PR for conventional style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# https://github.com/Namchee/conventional-pr
- uses: Namchee/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
close: false
issue: false
signed: false
label: invalid
commitlint:
name: Run commitlint on the PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# https://github.com/ahmadnassri/action-commit-lint
- uses: ahmadnassri/[email protected]

label:
name: Label PR derived from the conventional commit messages
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: label
# https://github.com/action-runner/conventional-labeler
uses: action-runner/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 13 additions & 1 deletion .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Semantic Release

on:
push:
Expand All @@ -18,7 +18,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
# https://github.com/semantic-release/semantic-release
# https://github.com/cycjimmy/semantic-release-action
# Semantic Release dry run:
# https://github.com/traefik/faency/pull/309
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
semantic_version: 19
ci: true
dry_run: false
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/git
57 changes: 54 additions & 3 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,57 @@
---
branches:
- "main"
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/github"
- - "@semantic-release/commit-analyzer"
- releaseRules:
- type: revert
release: patch
- type: perf
release: patch
- type: build
scope: deps
release: patch
- type: docs
scope: README.md
release: patch
- scope: no-release
release: false
- - "@semantic-release/release-notes-generator"
- - "@semantic-release/changelog"
- changelogFile: CHANGELOG.md
changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
- - "@semantic-release/git"
- message: "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
assets:
- CHANGELOG.md
- - "@semantic-release/github"
- assets:
- CHANGELOG.md
preset: conventionalcommits
presetConfig:
- types:
- type: feat
section": Features
- type: feature,
ssection": "Features"
- type: fix
section: Bug Fixes
- type: build
section": Updates to the Build System
hidden": false
- type: perf
section": "Performance Improvements"
- type: revert
section: Reverts
- type: docs
section: Documentation
- type: style
section: Styles
- type: chore
section: Miscellaneous Chores
- type: refactor
section: Code Refactoring
- type: test
section: Tests
- type: ci
section: Continuous Integration