Skip to content

Commit 32940ba

Browse files
authored
add verify workflow, fix lint issues (#2)
1 parent 082307c commit 32940ba

File tree

2 files changed

+71
-28
lines changed

2 files changed

+71
-28
lines changed

.github/workflows/verify.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: verify
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
types: [opened, synchronize]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
steps:
20+
- name: 🏗 Setup repo
21+
uses: actions/checkout@v4
22+
23+
- name: 🏗 Setup Bun
24+
uses: oven-sh/setup-bun@v2
25+
26+
- name: 📦 Install dependencies
27+
run: bun install
28+
29+
- name: 🔨 Compile sources
30+
run: bun tsc --noEmit
31+
32+
- name: ✅ Lint project
33+
run: bun lint

release.config.js

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const rules = [
33
{ type: 'fix', release: 'patch', title: 'Bug fixes' },
44
{ type: 'refactor', release: 'patch', title: 'Code refactors' },
55
{ type: 'docs', release: 'patch', title: 'Documentation changes' },
6-
{ type: 'chore', release: 'patch', title: 'Other changes' },
6+
{ type: 'chore', release: 'patch', title: 'Other changes' }
77
];
88

99
const sortMap = Object.fromEntries(rules.map((rule, index) => [rule.title, index]));
@@ -15,32 +15,42 @@ module.exports = {
1515
branches: ['main'],
1616
tagFormat: '${version}',
1717
plugins: [
18-
['@semantic-release/commit-analyzer', {
19-
preset: 'conventionalcommits',
20-
releaseRules: [
21-
{ breaking: true, release: 'major' },
22-
{ revert: true, release: 'patch' },
23-
].concat(
24-
rules.map(({ type, release }) => ({ type, release }))
25-
),
26-
}],
27-
['@semantic-release/release-notes-generator', {
28-
preset: 'conventionalcommits',
29-
presetConfig: {
30-
types: rules.map(({ type, title }) => ({ type, section: title })),
31-
},
32-
writerOpts: {
33-
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title],
34-
},
35-
}],
18+
[
19+
'@semantic-release/commit-analyzer',
20+
{
21+
preset: 'conventionalcommits',
22+
releaseRules: [
23+
{ breaking: true, release: 'major' },
24+
{ revert: true, release: 'patch' }
25+
].concat(rules.map(({ type, release }) => ({ type, release })))
26+
}
27+
],
28+
[
29+
'@semantic-release/release-notes-generator',
30+
{
31+
preset: 'conventionalcommits',
32+
presetConfig: {
33+
types: rules.map(({ type, title }) => ({ type, section: title }))
34+
},
35+
writerOpts: {
36+
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title]
37+
}
38+
}
39+
],
3640
'@semantic-release/changelog',
3741
['@semantic-release/npm', { npmPublish: false }],
38-
['@semantic-release/git', {
39-
message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}',
40-
assets: ['package.json', 'CHANGELOG.md'],
41-
}],
42-
['@semantic-release/github', {
43-
draftRelease: false,
44-
}],
45-
],
46-
};
42+
[
43+
'@semantic-release/git',
44+
{
45+
message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}',
46+
assets: ['package.json', 'CHANGELOG.md']
47+
}
48+
],
49+
[
50+
'@semantic-release/github',
51+
{
52+
draftRelease: false
53+
}
54+
]
55+
]
56+
};

0 commit comments

Comments
 (0)