Skip to content

add verify workflow, fix lint issues #2

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: verify

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup Bun
uses: oven-sh/setup-bun@v2

- name: 📦 Install dependencies
run: bun install

- name: 🔨 Compile sources
run: bun tsc --noEmit

- name: ✅ Lint project
run: bun lint
66 changes: 38 additions & 28 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const rules = [
{ type: 'fix', release: 'patch', title: 'Bug fixes' },
{ type: 'refactor', release: 'patch', title: 'Code refactors' },
{ type: 'docs', release: 'patch', title: 'Documentation changes' },
{ type: 'chore', release: 'patch', title: 'Other changes' },
{ type: 'chore', release: 'patch', title: 'Other changes' }
];

const sortMap = Object.fromEntries(rules.map((rule, index) => [rule.title, index]));
Expand All @@ -15,32 +15,42 @@ module.exports = {
branches: ['main'],
tagFormat: '${version}',
plugins: [
['@semantic-release/commit-analyzer', {
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' },
].concat(
rules.map(({ type, release }) => ({ type, release }))
),
}],
['@semantic-release/release-notes-generator', {
preset: 'conventionalcommits',
presetConfig: {
types: rules.map(({ type, title }) => ({ type, section: title })),
},
writerOpts: {
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title],
},
}],
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' }
].concat(rules.map(({ type, release }) => ({ type, release })))
}
],
[
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
presetConfig: {
types: rules.map(({ type, title }) => ({ type, section: title }))
},
writerOpts: {
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title]
}
}
],
'@semantic-release/changelog',
['@semantic-release/npm', { npmPublish: false }],
['@semantic-release/git', {
message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}',
assets: ['package.json', 'CHANGELOG.md'],
}],
['@semantic-release/github', {
draftRelease: false,
}],
],
};
[
'@semantic-release/git',
{
message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}',
assets: ['package.json', 'CHANGELOG.md']
}
],
[
'@semantic-release/github',
{
draftRelease: false
}
]
]
};