-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathrelease.config.js
More file actions
99 lines (94 loc) · 3.67 KB
/
Copy pathrelease.config.js
File metadata and controls
99 lines (94 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* Semantic Release Configuration
*
* Conservative versioning for 0.x development:
* - fix: → patch (0.1.2 → 0.1.3)
* - feat: → patch (0.1.2 → 0.1.3) - conservative until 1.0
* - feat!: or BREAKING CHANGE: → minor (0.1.x → 0.2.0) - not major while 0.x
* - perf:, refactor: → patch
* - docs:, chore:, test:, ci: → no release
*/
export default {
branches: ['master'],
repositoryUrl: 'https://github.com/framerslab/agentos',
tagFormat: 'v${version}',
plugins: [
// Analyze commits to determine release type
['@semantic-release/commit-analyzer', {
preset: 'conventionalcommits',
releaseRules: [
{ type: 'feat', release: 'patch' }, // Conservative: feat = patch until 1.0
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ type: 'revert', release: 'patch' },
{ breaking: true, release: 'minor' }, // BREAKING = minor while 0.x
// These don't trigger releases: docs, style, chore, test, ci, build
],
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING']
}
}],
// Generate release notes from commits
['@semantic-release/release-notes-generator', {
preset: 'conventionalcommits',
presetConfig: {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'perf', section: 'Performance' },
{ type: 'refactor', section: 'Code Refactoring' },
{ type: 'revert', section: 'Reverts' },
{ type: 'docs', section: 'Documentation', hidden: true },
{ type: 'chore', section: 'Maintenance', hidden: true },
{ type: 'test', section: 'Tests', hidden: true },
{ type: 'ci', section: 'CI/CD', hidden: true },
{ type: 'build', section: 'Build', hidden: true },
]
},
// Parser tweaks to keep the changelog clean:
// - referenceActions: [] → don't auto-link "closes #N" style refs.
// We don't use GitHub issues for closing tickets in commit
// messages; the historical parser used to misread hyphenated
// words like "high-level" as "hi#level" issue references.
// - issuePrefixes: [] → disable the "#N" reference scanner entirely.
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
referenceActions: [],
issuePrefixes: [],
},
// Writer tweaks: don't silently truncate long commit subjects.
// The default writer caps `header` at 100 chars and slices mid-word.
writerOpts: {
headerMaxLength: 500,
transform: (commit, context) => {
// conventional-changelog-writer@8 freezes commit objects, so
// we must return a new object instead of mutating in place.
if (commit.hash && typeof commit.hash === 'string') {
return { ...commit, shortHash: commit.hash.substring(0, 7) };
}
return commit;
},
},
}],
// Update CHANGELOG.md
['@semantic-release/changelog', {
changelogFile: 'CHANGELOG.md'
}],
// Publish to npm
['@semantic-release/npm', {
npmPublish: true
}],
// Commit version bump, changelog, and refreshed test-count badge.
['@semantic-release/git', {
assets: ['CHANGELOG.md', 'package.json', '.github/badges/tests.json'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}],
// Create GitHub release
['@semantic-release/github', {
successComment: false,
failComment: false,
releasedLabels: false
}]
]
};