Skip to content

Commit c3091d5

Browse files
committed
feat: initial commit
0 parents  commit c3091d5

File tree

100 files changed

+1826
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1826
-0
lines changed

.czrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "@commitlint/cz-commitlint"
3+
}

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
*.lockb binary diff=lockb

.github/workflows/check.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
permissions: {}
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
check:
16+
runs-on: ubuntu-22.04
17+
18+
permissions:
19+
contents: read # for checkout
20+
actions: read # for actions-timeline
21+
22+
steps:
23+
- name: actions-timeline
24+
# skip if the workflow is called from another workflow
25+
if: contains(github.workflow_ref, '/check.yml')
26+
# cspell:ignore kesin
27+
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0
28+
29+
- name: Checkout
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
fetch-depth: 0 # fetch all history for commitlint
33+
34+
- name: Setup bun
35+
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
36+
37+
- name: Setup Node.js
38+
# Install to use the latest version of Node.js when shebang is specified
39+
# ref: https://bun.sh/docs/cli/run#bun
40+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
41+
with:
42+
node-version-file: package.json
43+
44+
- name: Install Dependencies
45+
id: install
46+
run: bun install --frozen-lockfile
47+
env:
48+
HUSKY: 0
49+
50+
- name: "commitlint (push: initial commit)"
51+
id: commitlint-push-initial
52+
# commit hash will be 000... if it doesn't exist
53+
if: github.event_name == 'push' && github.event.before == '0000000000000000000000000000000000000000'
54+
run: bun run commitlint --verbose --to ${{ github.event.after }}
55+
56+
- name: commitlint (push)
57+
id: commitlint-push
58+
if: github.event_name == 'push' && steps.commitlint-push-initial.outcome == 'skipped'
59+
run: bun run commitlint --verbose --from ${{ github.event.before }} --to ${{ github.event.after }}
60+
61+
- name: commitlint (pull_request)
62+
id: commitlint-pr
63+
if: github.event_name == 'pull_request'
64+
run: |
65+
bun run commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
66+
67+
- name: commitlint (last commit)
68+
if: steps.commitlint-push-initial.outcome == 'skipped' && steps.commitlint-push.outcome == 'skipped' && steps.commitlint-pr.outcome == 'skipped'
69+
run: bun run commitlint --verbose --from ${{ github.sha }}~1 --to ${{ github.sha }}
70+
71+
- name: ignore-sync
72+
# continue even if the previous step fails
73+
# do not use continue-on-error because it will result in a successful job
74+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
75+
# run ignore-sync to check if the ignore file is up to date
76+
run: bun run ignore-sync
77+
78+
- name: Biome
79+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
80+
run: bun run biome ci --error-on-warnings .
81+
82+
- name: tsc (source)
83+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
84+
run: bun run tsc --project tsconfig.src.json --incremental false --noEmit
85+
86+
- name: tsc (other)
87+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
88+
run: bun run tsc --project tsconfig.base.json --incremental false
89+
90+
- name: cspell
91+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
92+
run: bun run cspell "**/*"
93+
94+
- name: knip
95+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
96+
run: bun run knip
97+
98+
- name: Check No Files are Changes
99+
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
100+
run: |
101+
git add .
102+
git diff --staged --exit-code

.github/workflows/lint-gha.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on:
4+
push:
5+
branches: main
6+
paths:
7+
- .github/workflows/**
8+
pull_request:
9+
paths:
10+
- .github/workflows/**
11+
workflow_dispatch:
12+
13+
permissions: {}
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-22.04
22+
23+
permissions:
24+
contents: read # for checkout
25+
actions: read # for actions-timeline
26+
27+
steps:
28+
- name: actions-timeline
29+
# cspell:ignore kesin
30+
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0
31+
32+
- name: Checkout
33+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
34+
with:
35+
sparse-checkout: |
36+
.github/workflows/*
37+
sparse-checkout-cone-mode: false
38+
39+
- name: Install actionlint
40+
# cspell:ignore jaxxstorm
41+
uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b # v1.11.0
42+
with:
43+
# cspell:ignore rhysd
44+
repo: rhysd/actionlint
45+
cache: enable
46+
47+
- name: Install pinact
48+
uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b # v1.11.0
49+
with:
50+
# cspell:ignore pinact
51+
repo: suzuki-shunsuke/pinact
52+
cache: enable
53+
54+
- name: Install ghalint
55+
id: install-ghalint
56+
uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b # v1.11.0
57+
with:
58+
# cspell:ignore shunsuke ghalint
59+
repo: suzuki-shunsuke/ghalint
60+
cache: enable
61+
62+
- name: Run actionlint
63+
run: actionlint -color
64+
65+
- name: Run ghalint
66+
# continue on error even if the previous step fails
67+
# do not use continue-on-error because it will result in a successful job
68+
if: ${{ !cancelled() && steps.install-ghalint.outcome == 'success' }}
69+
run: ghalint run
70+
env:
71+
GHALINT_LOG_COLOR: always
72+
73+
- name: Run pinact
74+
if: ${{ !cancelled() && steps.install-ghalint.outcome == 'success' }}
75+
uses: suzuki-shunsuke/pinact-action@a60b07ee63e41654915780a3297ff9f5f6b6db63 # v0.1.0
76+
with:
77+
skip_push: true # cannot push to the repository in the workflow unless using a PAT

.github/workflows/release.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: {}
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
check:
16+
permissions:
17+
# we must pass all the required permissions of the callee workflow
18+
contents: read
19+
actions: read
20+
uses: ./.github/workflows/check.yml
21+
22+
test:
23+
permissions:
24+
# we must pass all the required permissions of the callee workflow
25+
contents: read
26+
actions: read
27+
uses: ./.github/workflows/test.yml
28+
29+
release:
30+
needs:
31+
- check
32+
- test
33+
34+
runs-on: ubuntu-22.04
35+
36+
permissions:
37+
contents: write # for GitHub Release
38+
issues: write # for commenting on issues
39+
pull-requests: write # for commenting on pull requests
40+
id-token: write # for npm provenance
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
with:
46+
fetch-depth: 0 # fetch all history for semantic-release
47+
48+
- name: Setup bun
49+
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
50+
51+
- name: Setup Node.js
52+
# Install to use the new version of npm in semantic-release
53+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
54+
with:
55+
node-version-file: package.json
56+
57+
- name: Install Dependencies
58+
run: bun install --frozen-lockfile
59+
env:
60+
HUSKY: 0
61+
62+
- name: Build
63+
run: bun run tsc --project tsconfig.src.json --incremental false
64+
65+
- name: Release
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
run: bun run semantic-release
70+
71+
actions-timeline:
72+
needs:
73+
- release
74+
75+
if: ${{ !cancelled() }}
76+
77+
runs-on: ubuntu-22.04
78+
79+
permissions:
80+
actions: read # for actions-timeline
81+
82+
steps:
83+
- name: actions-timeline
84+
# cspell:ignore kesin
85+
uses: Kesin11/actions-timeline@b03a6aa289adef5534c84ccb6fbef7c975973574 # v2.1.0

0 commit comments

Comments
 (0)