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: add semantic-release workflow #166

Merged
merged 1 commit into from
Oct 10, 2024
Merged
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
80 changes: 80 additions & 0 deletions .github/workflows/semantic-release-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: Semantic releases

on:
workflow_call:
inputs:
runs_on:
type: string
default: ubuntu-latest

jobs:
semantic-release:
runs-on: ${{ inputs.runs_on }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get app token
id: app_token
uses: sencrop/github-workflows/actions/authenticate-github-app@master
with:
credentials: ${{ secrets.SENCROP_BOT_CREDENTIALS_TOKEN }}

- name: Write .releaserc
run: |
echo '{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "chore", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "deps", "release": "patch" },
{ "type": "ci", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "build", "release": "patch" },
{ "type": "style", "release": "patch" },
{ "type": "test", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "section": "New features", "hidden": false },
{ "type": "fix", "section": "Bug fixes", "hidden": false },
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
{ "type": "refactor", "section": "Code refactoring", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "deps", "section": "Dependencies update", "hidden": false },
{ "type": "ci", "section": "CI configuration", "hidden": false },
{ "type": "perf", "section": "Performance improvements", "hidden": false },
{ "type": "build", "section": "Build system", "hidden": false },
{ "type": "style", "section": "Style improvements", "hidden": false },
{ "type": "test", "section": "Test improvements", "hidden": false }
]
}
}
],
"@semantic-release/github"
]
}' > .releaserc

- name: Create github release only
uses: cycjimmy/[email protected]
with:
extra_plugins: |
[email protected]
env:
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}