Skip to content

Commit 7ef3707

Browse files
authored
fix: do less state resets (#18)
* fix: do less state resets * chore: update formatter to format everything * chore: maybe fix ci
1 parent ed3b4c4 commit 7ef3707

20 files changed

+403
-225
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
branches:
88
- main
99
tags:
10-
- 'v*.*.*'
11-
workflow_call: # Allow this workflow to be called by other workflows
10+
- "v*.*.*"
11+
workflow_call: # Allow this workflow to be called by other workflows
1212

1313
jobs:
1414
validate:
@@ -22,8 +22,8 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '22'
26-
cache: 'npm'
25+
node-version: "22"
26+
cache: "npm"
2727

2828
- name: Install dependencies
2929
run: npm ci
@@ -44,8 +44,8 @@ jobs:
4444
- name: Setup Node.js
4545
uses: actions/setup-node@v4
4646
with:
47-
node-version: '22'
48-
cache: 'npm'
47+
node-version: "22"
48+
cache: "npm"
4949

5050
- name: Install dependencies
5151
run: npm ci
@@ -71,13 +71,13 @@ jobs:
7171
- name: Setup Node.js
7272
uses: actions/setup-node@v4
7373
with:
74-
node-version: '22'
75-
cache: 'npm'
74+
node-version: "22"
75+
cache: "npm"
7676

7777
- name: Setup Julia
7878
uses: julia-actions/setup-julia@v2
7979
with:
80-
version: '1.11'
80+
version: "1.11"
8181

8282
- name: Install Pluto.jl
8383
run: julia -e 'using Pkg; Pkg.add("Pluto")'
@@ -103,8 +103,8 @@ jobs:
103103
- name: Setup Node.js
104104
uses: actions/setup-node@v4
105105
with:
106-
node-version: '22'
107-
cache: 'npm'
106+
node-version: "22"
107+
cache: "npm"
108108

109109
- name: Install dependencies
110110
run: npm ci

.github/workflows/commitlint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- name: Setup Node.js and install dependencies
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '22'
26-
cache: 'npm'
25+
node-version: "22"
26+
cache: "npm"
2727

2828
- name: Install dependencies
2929
run: npm ci
@@ -50,8 +50,8 @@ jobs:
5050
- name: Setup Node.js and install dependencies
5151
uses: actions/setup-node@v4
5252
with:
53-
node-version: '22'
54-
cache: 'npm'
53+
node-version: "22"
54+
cache: "npm"
5555

5656
- name: Install dependencies
5757
run: npm ci

.github/workflows/release.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
2323
name: Run CI
2424
uses: ./.github/workflows/ci.yml
2525

26-
# Automated release with semantic-release (no-commit mode)
27-
# This configuration creates releases without pushing version commits back to main
28-
# Perfect for repositories with strict branch protection/rulesets
26+
# Automated release with semantic-release
27+
# Creates GitHub releases, updates package.json and CHANGELOG.md, and commits changes back to main
2928
release:
3029
name: Semantic Release
3130
runs-on: ubuntu-latest
@@ -61,7 +60,7 @@ jobs:
6160
echo "filename=$VSIX_FILE" >> $GITHUB_OUTPUT
6261
echo "Built VSIX file: $VSIX_FILE"
6362
64-
- name: Run semantic-release (no-commit mode)
63+
- name: Run semantic-release
6564
env:
6665
GITHUB_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
6766
VSCE_PAT: ${{ secrets.VSCE_PAT }}
@@ -70,12 +69,26 @@ jobs:
7069
echo "Running in dry-run mode (no commits will be pushed)..."
7170
npx semantic-release --dry-run
7271
else
73-
echo "Running semantic-release in no-commit mode..."
74-
echo "This will create a GitHub release with VSIX but won't update package.json/CHANGELOG in the repo"
75-
echo "TODO: (and good first issue) actually introduce semantic release updating (after stable release) "
72+
echo "Running semantic-release..."
73+
echo "This will create a GitHub release, update package.json/CHANGELOG.md, and commit changes back to main"
7674
npx semantic-release
7775
fi
7876
77+
- name: Format CHANGELOG after semantic-release
78+
if: success() && github.event.inputs.dry_run != 'true'
79+
run: |
80+
if git diff --name-only HEAD~1 | grep -q "CHANGELOG.md"; then
81+
echo "CHANGELOG.md was updated, formatting it..."
82+
npx prettier --write CHANGELOG.md
83+
git config user.name "github-actions[bot]"
84+
git config user.email "github-actions[bot]@users.noreply.github.com"
85+
git add CHANGELOG.md
86+
git commit -m "chore: format CHANGELOG [skip ci]" || echo "No formatting changes needed"
87+
git push
88+
else
89+
echo "CHANGELOG.md was not updated, skipping formatting"
90+
fi
91+
7992
- name: Upload VSIX to release (fallback if semantic-release fails)
8093
if: failure()
8194
uses: actions/upload-artifact@v4

commitlint.config.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@
1919
*/
2020

2121
export default {
22-
extends: ['@commitlint/config-conventional'],
22+
extends: ["@commitlint/config-conventional"],
2323
rules: {
24-
'type-enum': [
24+
"type-enum": [
2525
2,
26-
'always',
26+
"always",
2727
[
28-
'feat',
29-
'fix',
30-
'docs',
31-
'style',
32-
'refactor',
33-
'perf',
34-
'test',
35-
'build',
36-
'ci',
37-
'chore',
38-
'revert',
28+
"feat",
29+
"fix",
30+
"docs",
31+
"style",
32+
"refactor",
33+
"perf",
34+
"test",
35+
"build",
36+
"ci",
37+
"chore",
38+
"revert",
3939
],
4040
],
41-
'type-case': [2, 'always', 'lower-case'],
42-
'type-empty': [2, 'never'],
43-
'scope-case': [2, 'always', 'lower-case'],
44-
'subject-empty': [2, 'never'],
45-
'subject-full-stop': [2, 'never', '.'],
46-
'header-max-length': [2, 'always', 100],
47-
'body-leading-blank': [1, 'always'],
48-
'body-max-line-length': [2, 'always', 100],
49-
'footer-leading-blank': [1, 'always'],
50-
'footer-max-line-length': [2, 'always', 100],
41+
"type-case": [2, "always", "lower-case"],
42+
"type-empty": [2, "never"],
43+
"scope-case": [2, "always", "lower-case"],
44+
"subject-empty": [2, "never"],
45+
"subject-full-stop": [2, "never", "."],
46+
"header-max-length": [2, "always", 100],
47+
"body-leading-blank": [1, "always"],
48+
"body-max-line-length": [2, "always", 100],
49+
"footer-leading-blank": [1, "always"],
50+
"footer-max-line-length": [2, "always", 100],
5151
},
5252
};

0 commit comments

Comments
 (0)