chore: replace release.config.js with .releaserc.json for semantic release configuration

This commit is contained in:
vincent-herlemont
2025-06-17 10:28:07 +09:00
parent 084a81809d
commit afbe3c6dfe
4 changed files with 153 additions and 52 deletions

View File

@@ -5,6 +5,7 @@ on:
branches: [ main, next ]
pull_request:
branches: [ main, next ]
workflow_dispatch:
jobs:
build_test_common_os:
@@ -24,7 +25,7 @@ jobs:
- uses: extractions/setup-just@v3
- uses: hustcer/setup-nu@v3.19
with:
version: '0.85'
version: '0.105.1'
- name: Just version
run: just --version
- name: Build
@@ -35,7 +36,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
needs: [build_test_common_os]
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
permissions:
contents: write
packages: write
@@ -44,19 +45,21 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: main
fetch-depth: 0
- name: install npm
uses: actions/setup-node@v4
with:
node-version: '16'
- name: install @semantic-release/exec
run: npm install @semantic-release/exec
node-version: '20'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
branch: main
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/exec
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.PAT_GLOBAL }}
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}

112
.releaserc Normal file
View File

@@ -0,0 +1,112 @@
{
"branches": [
"main"
],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"breaking": true,
"release": "minor"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"emoji": ":racehorse:",
"release": "patch"
},
{
"emoji": ":bug:",
"release": "patch"
},
{
"emoji": ":penguin:",
"release": "patch"
},
{
"emoji": ":apple:",
"release": "patch"
},
{
"emoji": ":checkered_flag:",
"release": "patch"
},
{
"tag": "BUGFIX",
"release": "patch"
},
{
"tag": "FEATURE",
"release": "minor"
},
{
"tag": "SECURITY",
"release": "patch"
},
{
"tag": "Breaking",
"release": "minor"
},
{
"tag": "Fix",
"release": "patch"
},
{
"tag": "Update",
"release": "minor"
},
{
"tag": "New",
"release": "minor"
},
{
"component": "perf",
"release": "patch"
},
{
"component": "deps",
"release": "patch"
},
{
"type": "FEAT",
"release": "minor"
},
{
"type": "FIX",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "bash version_update.sh ${nextRelease.version}",
"publishCmd": "bash cargo_publish.sh"
}
],
"@semantic-release/github"
]
}

View File

@@ -1,38 +0,0 @@
module.exports = {
branches: ['main'],
tagFormat: '${version}',
plugins: [
['@semantic-release/commit-analyzer', {
releaseRules: [
{breaking: true, release: 'minor'},
{revert: true, release: 'patch'},
{type: 'feat', release: 'minor'},
{type: 'fix', release: 'patch'},
{type: 'perf', release: 'patch'},
{type: 'docs', release: 'patch'},
{emoji: ':racehorse:', release: 'patch'},
{emoji: ':bug:', release: 'patch'},
{emoji: ':penguin:', release: 'patch'},
{emoji: ':apple:', release: 'patch'},
{emoji: ':checkered_flag:', release: 'patch'},
{tag: 'BUGFIX', release: 'patch'},
{tag: 'FEATURE', release: 'minor'},
{tag: 'SECURITY', release: 'patch'},
{tag: 'Breaking', release: 'minor'},
{tag: 'Fix', release: 'patch'},
{tag: 'Update', release: 'minor'},
{tag: 'New', release: 'minor'},
{component: 'perf', release: 'patch'},
{component: 'deps', release: 'patch'},
{type: 'FEAT', release: 'minor'},
{type: 'FIX', release: 'patch'},
],
}],
'@semantic-release/release-notes-generator',
['@semantic-release/exec', {
"prepareCmd": "bash version_update.sh ${nextRelease.version}",
"publishCmd": "bash cargo_publish.sh",
}],
'@semantic-release/github',
],
};

View File

@@ -1,6 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"extends": [
"config:base"
],
"semanticCommits": "enabled",
"semanticCommitType": "chore",
"semanticCommitScope": "deps",
@@ -8,14 +10,36 @@
"packageRules": [
{
"description": "Automerge non-major updates",
"matchUpdateTypes": ["minor", "patch"],
"matchUpdateTypes": [
"minor",
"patch"
],
"automerge": true
},
{
"description": "Automerge actions",
"matchDepTypes": ["action"],
"matchUpdateTypes": ["major", "minor", "patch"],
"automerge": true
"description": "Automerge actions",
"matchDepTypes": [
"action"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
],
"automerge": true
}
],
"regexManagers": [
{
"fileMatch": [
"^\\.github/workflows/[^/]+\\.ya?ml$"
],
"matchStrings": [
"uses: hustcer/setup-nu@.*?\\n.*?version: '\\s*(?<currentValue>.*?)'"
],
"depNameTemplate": "nushell",
"datasourceTemplate": "github-releases",
"packageNameTemplate": "nushell/nushell"
}
]
}