Skip to content

Commit 08fdf9a

Browse files
authored
Merge pull request #58 from kutsan/changesets-migration
Migrate project to `changesets`
2 parents 8623e3e + 7990ddc commit 08fdf9a

19 files changed

Lines changed: 2366 additions & 3423 deletions

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "kutsan/stylelint-config-clean-order",
7+
"disableThanks": true
8+
}
9+
],
10+
"commit": false,
11+
"fixed": [],
12+
"linked": [],
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}

.changeset/long-places-agree.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/dependabot.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
open-pull-requests-limit: 5
9+
groups:
10+
github-actions:
11+
patterns:
12+
- '*'
13+
commit-message:
14+
prefix: 'chore(deps)'
15+
16+
- package-ecosystem: npm
17+
directory: /
18+
schedule:
19+
interval: weekly
20+
open-pull-requests-limit: 10
21+
groups:
22+
dev-dependencies:
23+
dependency-type: development
24+
update-types:
25+
- minor
26+
- patch
27+
commit-message:
28+
prefix: 'chore(deps)'
29+
prefix-development: 'chore(deps-dev)'

.github/workflows/_build.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
artifact-name:
7+
description: 'Name of the uploaded build artifact.'
8+
value: ${{ jobs.build.outputs.artifact-name }}
9+
build-output-pathname:
10+
description: 'Build output directory relative to the workspace.'
11+
value: ${{ jobs.build.outputs.build-output-pathname }}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
outputs:
19+
artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }}
20+
build-output-pathname: ${{ steps.set-build-output-pathname.outputs.build-output-pathname }}
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v6
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v6
27+
28+
- name: Set up Node
29+
uses: actions/setup-node@v6
30+
with:
31+
node-version: '26'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Set artifact name
37+
id: set-artifact-name
38+
uses: actions/github-script@v7
39+
with:
40+
script: |
41+
const shortSha = context.sha.substring(0, 7)
42+
const artifactName = `build-${shortSha}`
43+
44+
core.setOutput('artifact-name', artifactName)
45+
46+
- name: Set build output pathname
47+
id: set-build-output-pathname
48+
uses: actions/github-script@v7
49+
with:
50+
script: |
51+
const buildOutputPathname = 'dist'
52+
core.setOutput('build-output-pathname', buildOutputPathname)
53+
54+
- name: Build
55+
run: pnpm run build
56+
57+
- name: Upload artifact
58+
uses: actions/upload-artifact@v7
59+
with:
60+
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
61+
path: ${{ github.workspace }}/${{ steps.set-build-output-pathname.outputs.build-output-pathname }}/

.github/workflows/_checks.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Checks
2+
3+
on:
4+
workflow_call: {}
5+
6+
jobs:
7+
checks:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- name: Run tests
16+
command: test
17+
- name: Lint code
18+
command: check:lint
19+
- name: Check types
20+
command: check:types
21+
- name: Check formatting
22+
command: check:format
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v6
26+
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v6
29+
30+
- name: Set up Node
31+
uses: actions/setup-node@v6
32+
with:
33+
node-version: '26'
34+
35+
- name: Install dependencies
36+
run: |
37+
pnpm install --frozen-lockfile
38+
39+
- name: ${{ matrix.name }}
40+
run: |
41+
pnpm run ${{ matrix.command }}

.github/workflows/ci.yaml

Lines changed: 25 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: CI
22

33
on:
4-
push:
5-
branches:
6-
- 'master'
74
pull_request:
85
branches:
96
- '*'
@@ -12,176 +9,59 @@ concurrency:
129
group: ${{ github.workflow }}-${{ github.ref }}
1310
cancel-in-progress: true
1411

15-
jobs:
16-
set-environment:
17-
runs-on: ubuntu-latest
18-
permissions:
19-
contents: read
20-
outputs:
21-
environment: ${{ steps.set-environment.outputs.environment }}
22-
steps:
23-
- name: Set Environment
24-
id: set-environment
25-
uses: actions/github-script@v7
26-
with:
27-
script: |
28-
const isPush = context.eventName === 'push'
29-
const isMain = context.ref === 'refs/heads/master'
30-
31-
let environment = 'preview'
32-
33-
if (isPush && isMain) {
34-
environment = 'production'
35-
}
36-
37-
console.log(`Environment resolved to "${environment}".`)
38-
core.setOutput('environment', environment)
12+
permissions:
13+
contents: read
3914

40-
checks:
15+
jobs:
16+
commitlint:
17+
name: commitlint
4118
runs-on: ubuntu-latest
42-
permissions:
43-
contents: read
44-
needs: [set-environment]
45-
strategy:
46-
fail-fast: false
47-
matrix:
48-
include:
49-
- name: Run tests
50-
command: test
51-
- name: Lint code
52-
command: check:lint
53-
- name: Check types
54-
command: check:types
55-
- name: Check formatting
56-
command: check:format
5719
steps:
5820
- name: Checkout code
59-
uses: actions/checkout@v4
60-
61-
- name: Install pnpm
62-
uses: pnpm/action-setup@v4
63-
64-
- name: Set up Node
65-
uses: actions/setup-node@v4
21+
uses: actions/checkout@v6
6622
with:
67-
node-version: 'lts/*'
68-
cache: 'pnpm'
69-
70-
- name: Install dependencies
71-
run: |
72-
pnpm install --frozen-lockfile
73-
74-
- name: ${{ matrix.name }}
75-
run: |
76-
pnpm run ${{ matrix.command }}
77-
78-
build:
79-
needs: [set-environment, checks]
80-
permissions:
81-
contents: read
82-
runs-on: ubuntu-latest
83-
if: ${{ needs.set-environment.outputs.environment == 'production' }}
84-
environment:
85-
name: ${{ needs.set-environment.outputs.environment }}
86-
outputs:
87-
artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }}
88-
build-output-pathname: ${{ steps.set-build-output-pathname.outputs.build-output-pathname }}
89-
steps:
90-
- name: Checkout code
91-
uses: actions/checkout@v4
23+
fetch-depth: 0
9224

9325
- name: Install pnpm
94-
uses: pnpm/action-setup@v4
26+
uses: pnpm/action-setup@v6
9527

9628
- name: Set up Node
9729
uses: actions/setup-node@v6
9830
with:
99-
node-version: 'lts/*'
100-
cache: 'pnpm'
31+
node-version: '26'
10132

10233
- name: Install dependencies
103-
run: |
104-
pnpm install --frozen-lockfile
105-
106-
- name: Set artifact name
107-
id: set-artifact-name
108-
uses: actions/github-script@v7
109-
with:
110-
script: |
111-
const shortSha = context.sha.substring(0, 7)
112-
const artifactName = `build-${shortSha}`
34+
run: pnpm install --frozen-lockfile
11335

114-
core.setOutput('artifact-name', artifactName)
36+
- name: Lint commit messages
37+
run: pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
11538

116-
- name: Build
117-
run: |
118-
pnpm run build
119-
120-
- name: Set build output pathname
121-
id: set-build-output-pathname
122-
uses: actions/github-script@v7
123-
with:
124-
script: |
125-
const buildOutputPathname = 'dist'
126-
core.setOutput('build-output-pathname', buildOutputPathname)
127-
128-
- name: Upload artifact
129-
uses: actions/upload-artifact@v4
130-
with:
131-
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
132-
path: ${{ github.workspace }}/${{ steps.set-build-output-pathname.outputs.build-output-pathname }}/
133-
134-
release:
135-
needs: [set-environment, checks, build]
39+
changeset:
40+
name: changeset
13641
runs-on: ubuntu-latest
137-
if: ${{ needs.set-environment.outputs.environment == 'production' }}
138-
environment:
139-
name: ${{ needs.set-environment.outputs.environment }}
140-
permissions:
141-
id-token: write # To enable use of OIDC for npm provenance.
142-
contents: write # To be able to publish a GitHub release.
143-
issues: write # To be able to comment on released issues.
144-
pull-requests: write # To be able to comment on released pull requests.
42+
if: github.actor != 'dependabot[bot]'
14543
steps:
14644
- name: Checkout code
147-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
14846
with:
14947
fetch-depth: 0
150-
ssh-key: '${{ secrets.DEPLOY_KEY }}'
15148

15249
- name: Install pnpm
153-
uses: pnpm/action-setup@v4
50+
uses: pnpm/action-setup@v6
15451

15552
- name: Set up Node
15653
uses: actions/setup-node@v6
15754
with:
158-
node-version: 'lts/*'
159-
cache: 'pnpm'
55+
node-version: '26'
16056

16157
- name: Install dependencies
162-
run: |
163-
pnpm install --frozen-lockfile
164-
165-
- name: Download build artifacts
166-
uses: actions/download-artifact@v4
167-
with:
168-
name: ${{ needs.build.outputs.artifact-name }}
169-
path: ${{ github.workspace }}/${{ needs.build.outputs.build-output-pathname }}
58+
run: pnpm install --frozen-lockfile
17059

171-
- name: Update npm
172-
run: |
173-
npm install --global npm@latest
60+
- name: Fetch base branch
61+
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1
17462

175-
- name: Verify npm package signatures
176-
run: |
177-
npm audit signatures
63+
- name: Verify changeset exists
64+
run: pnpm exec changeset status --since=origin/${{ github.event.pull_request.base.ref }}
17865

179-
- name: Create a release
180-
env:
181-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182-
GIT_AUTHOR_NAME: 'github-actions[bot]'
183-
GIT_COMMITTER_NAME: 'github-actions[bot]'
184-
GIT_AUTHOR_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
185-
GIT_COMMITTER_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
186-
run: |
187-
pnpm exec -- semantic-release --repository-url "git@github.com:${{ github.repository }}.git"
66+
checks:
67+
uses: ./.github/workflows/_checks.yaml

0 commit comments

Comments
 (0)