Skip to content

Commit fef29ae

Browse files
committed
chore: implement CI, commitlint, and release workflows
1 parent 4aaa34e commit fef29ae

7 files changed

Lines changed: 120 additions & 263 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint & Typecheck
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v2
16+
- run: bun install --frozen-lockfile
17+
- run: bun run lint
18+
- run: bun run typecheck

.github/workflows/commitlint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Commitlint
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
commitlint:
9+
name: Lint Commits
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- uses: wagoid/commitlint-github-action@v6

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version bump"
8+
required: true
9+
default: "patch"
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
release:
18+
name: Release
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
id-token: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
- uses: oven-sh/setup-bun@v2
29+
- run: bun install --frozen-lockfile
30+
- name: Configure Git
31+
run: |
32+
git config user.name "${GITHUB_ACTOR}"
33+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
34+
- name: Configure npm auth
35+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
36+
- name: Release
37+
working-directory: packages/react-native-bread
38+
run: bun run release --ci --increment ${{ inputs.version }}
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ coverage/
3232
*.tgz
3333
.env
3434
.env.local
35+
36+
# Auto-generated by prepack
37+
packages/react-native-bread/README.md

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@
99
"lint": "biome check .",
1010
"lint:fix": "biome check --write .",
1111
"format": "biome format --write .",
12-
"clean": "bun run --cwd packages/react-native-bread clean"
12+
"clean": "bun run --cwd packages/react-native-bread clean",
13+
"postinstall": "simple-git-hooks"
14+
},
15+
"simple-git-hooks": {
16+
"commit-msg": "bunx commitlint --edit $1"
17+
},
18+
"commitlint": {
19+
"extends": ["@commitlint/config-conventional"]
1320
},
1421
"devDependencies": {
15-
"@biomejs/biome": "^2.3.11"
22+
"@biomejs/biome": "^2.3.11",
23+
"@commitlint/cli": "^20.4.2",
24+
"@commitlint/config-conventional": "^20.4.2",
25+
"simple-git-hooks": "^2.13.1"
1626
}
1727
}

packages/react-native-bread/README.md

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

0 commit comments

Comments
 (0)