Skip to content

Commit 1dd7f06

Browse files
authored
chore: merge pull request #3 from addon-stack/develop
Release
2 parents 321458f + 9ebcee9 commit 1dd7f06

23 files changed

Lines changed: 10126 additions & 1473 deletions

.commitlintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.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: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- 'feature/**'
8+
pull_request:
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
19+
20+
jobs:
21+
compute-matrix:
22+
name: Compute matrix
23+
runs-on: ubuntu-latest
24+
outputs:
25+
matrix: ${{ steps.set.outputs.matrix }}
26+
name_suffix: ${{ steps.set.outputs.name_suffix }}
27+
steps:
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
37+
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
44+
strategy:
45+
fail-fast: false
46+
matrix: ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
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
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: ${{ matrix.node }}
61+
cache: npm
62+
63+
- name: Install dependencies
64+
run: npm ci
65+
66+
- name: Lint
67+
run: npm run lint
68+
69+
- name: Typecheck
70+
run: npm run typecheck
71+
72+
- name: Test
73+
run: npm run test:ci
74+
75+
- name: Build
76+
run: npm run build
77+
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.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+

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
3+
# Husky commit-msg hook: validate commit message with commitlint
4+
5+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
# Husky pre-commit hook: format and run related tests on staged files
4+
5+
npm run lint:fix:aggressive || exit 1;
6+
npm run test || exit 1;
7+
npm run format || exit 1;

.husky/pre-push

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
# Husky pre-push hook: typecheck, run full tests, and build
4+
5+
npm run typecheck || exit 1
6+
npm run test:ci || exit 1
7+
npm run build || exit 1

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Addon Stack <191148085+addon-stack@users.noreply.github.com> <addonbonedev@gmail.com>
2+
Addon Stack <addon-stack@users.noreply.github.com> <addonbonedev@gmail.com>

.prettierignore

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

.prettierrc

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

0 commit comments

Comments
 (0)