Skip to content

Commit 6ca96ee

Browse files
authored
chore: merge pull request #9 from addon-stack/develop
2 parents 0ebf00b + aa79667 commit 6ca96ee

21 files changed

+1415
-1649
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Enforce LF for all text files
2+
* text=auto eol=lf
3+
4+
# Keep Windows command scripts with CRLF line endings
5+
*.bat text eol=crlf
6+
*.cmd text eol=crlf

.github/workflows/ci.yml

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,60 @@
11
name: CI
22

33
on:
4+
push:
5+
branches:
6+
- develop
7+
- 'feature/**'
48
pull_request:
5-
branches: [develop, main]
6-
workflow_call: {}
7-
8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
10-
cancel-in-progress: true
9+
branches:
10+
- develop
11+
- 'feature/**'
12+
workflow_call:
13+
inputs:
14+
full:
15+
description: 'Run full OS x Node matrix'
16+
required: false
17+
type: boolean
18+
default: false
1119

1220
jobs:
13-
build-and-test:
21+
compute-matrix:
22+
name: Compute matrix
1423
runs-on: ubuntu-latest
24+
outputs:
25+
matrix: ${{ steps.set.outputs.matrix }}
26+
name_suffix: ${{ steps.set.outputs.name_suffix }}
1527
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20
23-
cache: npm
24-
25-
- name: Install dependencies
26-
run: npm ci
27-
28-
- name: Lint (Biome)
29-
run: npm run lint
30-
31-
- name: Format check (Biome)
32-
run: npm run format:check
28+
- id: set
29+
run: |
30+
if [[ "${{ inputs.full }}" == "true" ]]; then
31+
echo 'matrix={"os":["ubuntu-latest","windows-latest"],"node":[18,20,22]}' >> $GITHUB_OUTPUT
32+
echo 'name_suffix=(full matrix)' >> $GITHUB_OUTPUT
33+
else
34+
echo 'matrix={"os":["ubuntu-latest"],"node":[20]}' >> $GITHUB_OUTPUT
35+
echo 'name_suffix=' >> $GITHUB_OUTPUT
36+
fi
3337
34-
- name: Typecheck
35-
run: npm run typecheck
36-
37-
- name: Test (Jest)
38-
run: npm run test:ci
39-
40-
- name: Build (rslib)
41-
run: npm run build
42-
43-
- name: Check publish contents (npm pack dry run)
44-
run: npm pack --dry-run
45-
46-
full-matrix:
47-
if: github.event_name == 'pull_request' && github.base_ref == 'main' || github.ref == 'refs/heads/main'
48-
needs: build-and-test
49-
runs-on: ubuntu-latest
38+
build-and-test:
39+
name: Build, Lint, Test ${{ needs.compute-matrix.outputs.name_suffix }}
40+
needs: compute-matrix
41+
runs-on: ${{ matrix.os }}
42+
permissions:
43+
contents: read
5044
strategy:
5145
fail-fast: false
52-
matrix:
53-
node: [18, 20, 22]
46+
matrix: ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
5447
steps:
5548
- name: Checkout
5649
uses: actions/checkout@v4
5750

58-
- name: Setup Node.js
51+
- name: Configure git EOL (Windows)
52+
if: runner.os == 'Windows'
53+
run: |
54+
git config core.autocrlf false
55+
git config core.eol lf
56+
57+
- name: Use Node.js
5958
uses: actions/setup-node@v4
6059
with:
6160
node-version: ${{ matrix.node }}
@@ -64,14 +63,21 @@ jobs:
6463
- name: Install dependencies
6564
run: npm ci
6665

66+
- name: Lint
67+
run: npm run lint
68+
6769
- name: Typecheck
6870
run: npm run typecheck
6971

70-
- name: Test (Jest)
72+
- name: Test
7173
run: npm run test:ci
7274

73-
- name: Build (rslib)
75+
- name: Build
7476
run: npm run build
7577

76-
- name: Check publish contents (npm pack dry run)
77-
run: npm pack --dry-run
78+
- name: Upload coverage artifact
79+
if: always()
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: coverage-${{ matrix.os }}-node${{ matrix.node }}
83+
path: coverage

.github/workflows/release-prepare.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release-publish.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Exact version to release (e.g. 1.2.3). Leave empty to auto-bump.'
11+
required: false
12+
type: string
13+
preid:
14+
description: 'Pre-release identifier (e.g. beta, rc). Optional'
15+
required: false
16+
type: string
17+
npm_tag:
18+
description: 'npm dist-tag (e.g. latest, beta)'
19+
required: false
20+
default: 'latest'
21+
type: string
22+
23+
permissions:
24+
contents: write
25+
id-token: write
26+
27+
jobs:
28+
ci:
29+
name: CI
30+
uses: ./.github/workflows/ci.yml
31+
with:
32+
full: true
33+
34+
release:
35+
name: Release & Publish
36+
runs-on: ubuntu-latest
37+
needs: ci
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
fetch-tags: true
44+
45+
- name: Use Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: 20
49+
cache: 'npm'
50+
registry-url: 'https://registry.npmjs.org'
51+
always-auth: true
52+
53+
- name: Install dependencies
54+
run: npm ci
55+
56+
- name: Configure Git user
57+
run: |
58+
git config user.name "github-actions[bot]"
59+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
60+
61+
- name: Run release-it
62+
env:
63+
DEBUG: release-it:*,@release-it/*
64+
HUSKY: 0
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68+
run: |
69+
VERSION_ARG=""
70+
if [ -n "${{ inputs.version }}" ]; then
71+
VERSION_ARG="${{ inputs.version }}"
72+
fi
73+
74+
PREID_ARG=""
75+
if [ -n "${{ inputs.preid }}" ]; then
76+
PREID_ARG="--preRelease=${{ inputs.preid }}"
77+
fi
78+
79+
if [ -n "${{ inputs.npm_tag }}" ]; then
80+
NPM_TAG="${{ inputs.npm_tag }}"
81+
else
82+
NPM_TAG="latest"
83+
fi
84+
NPM_TAG_ARG="--npm.tag=${NPM_TAG}"
85+
86+
npm run release -- --ci $PREID_ARG $NPM_TAG_ARG $VERSION_ARG
87+
88+
- name: Sync main → develop
89+
uses: devmasx/merge-branch@v1.4.0
90+
with:
91+
type: now
92+
from_branch: main
93+
target_branch: develop
94+
github_token: ${{ secrets.GITHUB_TOKEN }}
95+
env:
96+
HUSKY: 0
97+

.gitignore

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
# Local
21
.DS_Store
3-
*.local
4-
*.log*
5-
6-
# Dist
7-
node_modules
8-
dist/
9-
.rslib/
10-
storybook-static
11-
12-
# IDE
13-
.vscode/*
14-
!.vscode/extensions.json
2+
.env
3+
.env.*
154
.idea
5+
.output
6+
addon
7+
*.log
8+
/.vscode/
9+
/docs/.vitepress/cache
10+
coverage
11+
dist
12+
package
13+
node_modules
14+
TODOs.md
15+
stats.html
16+
.tool-versions
17+
.cache
18+
*-stats.txt

0 commit comments

Comments
 (0)